Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    20

    Unanswered: 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

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

  3. #3
    Join Date
    Jan 2004
    Posts
    20
    Thanks a lot. It is working fine in my queries.


    Regards,
    Deepak Ajmera

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •