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 > db2v8fp4 Win2kProf: Selecting null values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-13-04, 06:50
deepaka deepaka is offline
Registered User
 
Join Date: Jan 2004
Posts: 20
db2v8fp4 Win2kProf: Selecting null values

Dear All,

I am running db2 version 8 fix pack 4 on Win2k Prof. IS there any equivalent of oracle query

select null from dual;

like select null from sysibm.sysdummy1; (though this is not working)

in db2?

Thanks

Regards,
Deepak Ajmera
Reply With Quote
  #2 (permalink)  
Old 02-13-04, 08:05
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Deepak,
DB2 wants to know what data types the columns of the result set are. NULL has no intrinsic data type in of itself. You need to cast it to a data type for this to work. For example:

select cast(null as integer) from sysibm.sysdummy1

HTH

Andy
Reply With Quote
  #3 (permalink)  
Old 02-14-04, 02:45
deepaka deepaka is offline
Registered User
 
Join Date: Jan 2004
Posts: 20
Thanks a lot. It is working fine in my queries.


Regards,
Deepak Ajmera
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