If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > What is the equivalent function for isnull in db2?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-07-03, 14:37
nmkumaran nmkumaran is offline
Registered User
 
Join Date: Mar 2003
Posts: 35
Wink What is the equivalent function for isnull in db2?

Hi All,
I want to know the equivalent function for isnull in db2
In oracle we can use isnull in predicated for fetching the null values, but we dont have same function in db2? is anyother way to fetch null values through any db2 function.

udb v8.1 in solaris

if any one know please let me know.
thanks
kumar
Reply With Quote
  #2 (permalink)  
Old 11-07-03, 17:15
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: What is the equivalent function for isnull in db2?

ISNULL, I believe is in SQL Server and Sybase ...

NVL is Oracle function

and

COALESCE is the equivalent DB2 function .

To clarify, COALESCE(col1,col2) returns col2 if col1 is null or col1 is col1 is not null ...

If I have misunderstood , then ...

If you want to fetch the rows if a column col1 has null values , then
WHERE COL1 IS NULL




Quote:
Originally posted by nmkumaran
Hi All,
I want to know the equivalent function for isnull in db2
In oracle we can use isnull in predicated for fetching the null values, but we dont have same function in db2? is anyother way to fetch null values through any db2 function.

udb v8.1 in solaris

if any one know please let me know.
thanks
kumar
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 11-07-03, 18:18
nmkumaran nmkumaran is offline
Registered User
 
Join Date: Mar 2003
Posts: 35
Talking Re: thanks a lot

Thanks a lot.


Quote:
Originally posted by sathyaram_s
ISNULL, I believe is in SQL Server and Sybase ...

NVL is Oracle function

and

COALESCE is the equivalent DB2 function .

To clarify, COALESCE(col1,col2) returns col2 if col1 is null or col1 is col1 is not null ...

If I have misunderstood , then ...

If you want to fetch the rows if a column col1 has null values , then
WHERE COL1 IS NULL
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On