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
 

 

Type casting fields in select query

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

New User


Joined: 24 Jan 2007
Posts: 59
Location: Texas

PostPosted: Wed Apr 04, 2007 9:57 pm    Post subject: Type casting fields in select query
Reply with quote

While unloading records from table, i want to type cast the float values to char.
this i am doing in this way

select r1 , r2 , r3 , char(r4) , r5 , char(r6)
from table
with ur;

where consider r4 and r6 as float fileds, that i am type casting it to char.

note: all these fields are nullable.

But in the result i am not getting null indicators for r4 and r6.

Pls give me solution. or suggest other ways of type casting in select query.
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: Thu Apr 05, 2007 1:47 am    Post subject:
Reply with quote

Hello,

Was there some reason to post the same question in 2 forums?

I'll delete one if you'll let me know which one you'd like to keep. . .
Back to top
View user's profile Send private message
rarvins

New User


Joined: 24 Jan 2007
Posts: 59
Location: Texas

PostPosted: Mon Apr 09, 2007 10:15 am    Post subject: Re: Type casting fields in select query
Reply with quote

Sorry for that, i wrongly posted it in Pl/ASSEMBLER forum, i wanted to post in DB2 forum, So i repeated it in DB2. So you can go a head and delete the query posted in PL/ASSEMBLER forum. and also please do help me.
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: Tue Apr 10, 2007 4:22 am    Post subject:
Reply with quote

Hello,

Not to worry - i've deleted the "other" one icon_smile.gif

Is there a reason to type cast in the select? If you process the select with them as float, do you see the null indicator? If you see the null for the float values, possibly you could deal with them inside the code after the select.
Back to top
View user's profile Send private message
rarvins

New User


Joined: 24 Jan 2007
Posts: 59
Location: Texas

PostPosted: Tue Apr 10, 2007 10:32 am    Post subject: Re: Type casting fields in select query
Reply with quote

yes if i give without typecast, the null indicators are coming.so as you said i am selecting without typecast and handling them in coboldb2 program.
thank you for your help.
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: Tue Apr 10, 2007 6:47 pm    Post subject:
Reply with quote

You're welcome icon_smile.gif
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am


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