In Oracle, if you want to view the current date and time, use select sysdate from dual;
So is there a system table like dual in oracle in db2? The answer is yes at the time, that is, sysibm. sysdummy. The schema of the front edge must be added; otherwise, an error will be reported if the schema you use is not sysibm.
You can use the following statement:
Select current_date, current_time, current_timestamp from sysibm. sysdummy1;
1 2 3
-------------------------------------------------------------------------
2011-10-10 10:23:39 2011-10-10-10.23.39.953000
At the same time, if there is another interesting values in db2cmd
Db2 => values current_date ---- display the current date
Db2 => values current_time ---- display the current time
Db2 => values current_timestamp ---- display the current Timestamp
Db2 => values 1 + 2 ---- displays the value of 1 + 2, which can be used as a calculator. Convenient