Friday, April 26, 2013

on
In DB2 , sysibm.sysdummy1 table is a special memory table which can be used to get the current date, time, and timestamp using SQL 

1. To get the Current Date in DB2 , use the following query 
SELECT current date FROM sysibm.sysdummy1 

2. To get the Current Time in DB2 , use the following query 
SELECT current time FROM sysibm.sysdummy1 

2. To get the Current TimeStamp in DB2 , use the following query 
SELECT current timestamp FROM sysibm.sysdummy1 

We can also use the VALUES keyword to evaluate the current date, time, and timestamp or expression. From the DB2 Command Line Processor (CLP), Issue the following SQL statements

db2=> VALUES current date - displays the current date
db2=> VALUES current time - displays the current time
db2=> VALUES current timestamp - displays the current timestamp
db2=> VALUES 10+4 - displays 14 (evaluates the expression)

To get the current time or current timestamp adjusted to GMT/CUT, subtract the current timezone register from the current time or timestamp:

db2=> VALUES current time - current timezone 

db2=> VALUES current timestamp - current timezone

1 comments:

  1. Motivation is the art of getting people to do what you want them to do because they want to do it. See the link below for more info.

    #getting
    www.matreyastudios.com

    ReplyDelete