DB2 – Timestamp and Sysdummy1

SYSIBM.SYSDUMMY1 is an EBCDIC table, provided by DB2. It is used when we need to fetch data that is not in a table, For e.g. Current Date, Current Time etc..

Example

>DB2 SELECT 2+3 FROM SYSIBM.SYSDUMMY1
Output:

1
 -----------
5

1 record(s) selected.

>DB2 SELECT CURRENT DATE FROM SYSIBM.SYSDUMMY1
Output:

1
 ----------
 05/04/2011

1 record(s) selected.

>DB2 SELECT CURRENT TIMESTAMP FROM SYSIBM.SYSDUMMY1
Output:

1
--------------------------
2011-05-04-10.29.10.754000

1 record(s) selected.
Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.