Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us