Personal tools
You are here: Home Forums DB2 Select null as xyz from sysibm.sysdummy1--not work????
Navigation
Log in


Forgot your password?
 
Document Actions

Select null as xyz from sysibm.sysdummy1--not work????

Up to DB2

Select null as xyz from sysibm.sysdummy1--not work????

Posted by Pawan at May 08. 2008


Select null as xyz from sysibm.sysdummy1


why above query does not work in db2



while


select null from dual work in oracle.....



is there any alternative of this issue????



Thanks & Regards


Pawan



Re: Select null as xyz from sysibm.sysdummy1--not work????

Posted by Pawan at June 03. 2008

no reply???


Re: Select null as xyz from sysibm.sysdummy1--not work????

Posted by Gnana Sekaran Nallathambi at June 06. 2008

The above query returns SQLCODE = -206, saying NULL IS NOT VALID IN THE CONTEXT WHERE IT IS USED.



Could you please let us know your exact requirement?


Re: Select null as xyz from sysibm.sysdummy1--not work????

Posted by perallis at July 03. 2009

On DB2 you have to use nullif(0,0) to select numeric data oy nullif('0','0'), see the example below:

db2 "select nullif(0,0) from sysibm.sysdummy1"


Powered by Ploneboard
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls