IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Type casting fields in select query


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Thu Apr 05, 2007 1:47 am
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
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

Moderator Emeritus


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

PostPosted: Tue Apr 10, 2007 4:22 am
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
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

Moderator Emeritus


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

PostPosted: Tue Apr 10, 2007 6:47 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts SMF record type 30 JCL & VSAM 8
Search our Forums:

Back to Top