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
 
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Setting Font Type for XMIT satish.ms10 All Other Mainframe Topics 3 Fri Sep 15, 2017 10:01 pm

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