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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm


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