Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Character field failed conversion in numeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Fri Sep 21, 2007 4:01 pm    Post subject: Character field failed conversion in numeric field
Reply with quote

Hi,

When I am trying to extract rows from a table based on the DATE (VARDATE is the column name), I am getting an error in which it is giving the display as "

A character field failed conversion to numeric field

I am using the query:

SELECT * FROM <table name>
WHERE VARDATE IN ('12/1/2006')

Please help me out regarding the same.
Back to top
View user's profile Send private message

twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Fri Sep 21, 2007 4:49 pm    Post subject:
Reply with quote

Swapadeep,

What's the type of VARDATE? Maybe it was a DECIMAL type field (of course with no date separators) which doesn't require quotes.

Cheers, T.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Fri Sep 21, 2007 5:34 pm    Post subject:
Reply with quote

Last I checked, DB2 date formats are 2006-12-01
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 21, 2007 5:51 pm    Post subject:
Reply with quote

stodolas wrote:
Last I checked, DB2 date formats are 2006-12-01

The default string version of a date is yyyy-mm-dd but DB2 will accept dates in other formats. Is the select * from actually a select into? If it is then the format of one of the host variables is incorrect.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 21, 2007 6:09 pm    Post subject:
Reply with quote

Hello,

Did you post the entire query?

Is this query being run in a program, spufi, or somewhere else?

What sql return code did you get? If you post any and all diagnostic the system provided it may help.

If you copy/paste it is usually faster and more readable.
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Fri Sep 21, 2007 6:57 pm    Post subject:
Reply with quote

Swapnadeep,

Use '-' (hyphen) as the date separatro and see it works..!
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Sep 21, 2007 7:38 pm    Post subject:
Reply with quote

twissi wrote:
Swapnadeep,

Use '-' (hyphen) as the date separatro and see it works..!


If the date is formatted as yyyy-mm-dd then the '-' is the correct separator but for mm/dd/yyyy you have to use '/'.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us