Results 1 to 5 of 5

Thread: System Date

  1. #1
    Join Date
    Dec 2001
    Posts
    40

    Unanswered: System Date

    I am fairly new to DB2. I was wondering if somebody can tell me if there is a way to get the system date from DB2.
    For example, in Oracle
    SQL> select sysdate from dual;
    SYSDATE
    ---------
    17-DEC-01

    where dual is just a dummy table. It can be any table_name.

    Thanks

  2. #2
    Join Date
    Dec 2001
    Location
    Sao Paulo - Brazil
    Posts
    6
    You can try this one

    db2 select current date from sysibm.sysdummy1

    sysibm.sysdummy is the "Oracke dual" for DB2.

  3. #3
    Join Date
    Dec 2001
    Posts
    40
    That's exactly what I wanted. Thanks.
    Actually I wanted more info like time etc..
    So,
    select current timestamp from sysibm.sysdummy1
    worked better for me.

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    easier is to use

    values(current timestamp)

    Cheers

    Sathyaram

    Originally posted by ryanveach
    That's exactly what I wanted. Thanks.
    Actually I wanted more info like time etc..
    So,
    select current timestamp from sysibm.sysdummy1
    worked better for me.

  5. #5
    Join Date
    Jun 2005
    Location
    Chennai
    Posts
    16

    sysibm.sysdummy1 ?

    Can you tell me more about this in-memory table sysibm.sysdummy1.
    ?
    Learning, Keep on learning.....

Posting Permissions

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