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

IFNULL statement in DB2


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vinni

New User


Joined: 10 Jun 2008
Posts: 3
Location: Hyderabad

PostPosted: Wed Jul 28, 2010 11:42 pm
Reply with quote

Hi,

If i have select some columns using the below statement from a table

IFNULL(a.Col_name_1, CHAR(‘ ‘,10)) as name1,
IFNULL(a.Col_name_3, CHAR(‘ ‘,40)) as name2 from table a.

What does the above statement do exactly ? and name1 can be a column name of another table or it should be some other name if yes do i need to declare it ?

Thanks for the help.

vinni.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 28, 2010 11:57 pm
Reply with quote

IFNULL as explained in the manual

AS column_name as explained in the manual
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Thu Jul 29, 2010 1:07 am
Reply with quote

... and both explained by a very simple test.
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 JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
No new posts process statement for SUPREC, CMPCOLM... TSO/ISPF 4
No new posts SYNCSORT/ICETOOL JOINKEYS SORT Statem... DFSORT/ICETOOL 13
No new posts DFDSS COPY using Filter REFDT statement JCL & VSAM 2
Search our Forums:

Back to Top