CURRENT TIME

The CURRENT TIME special register specifies a time that is based on a reading of the time-of-day clock when the SQL statement is executed at the current server.

If this special register is used more than one time within a single SQL statement, or used with CURRENT DATE or CURRENT TIMESTAMP within a single statement, all values are based on a single clock reading.1

The value of CURRENT TIME in a user-defined function or stored procedure is inherited according to the rules in Table 1. For other applications, the time is derived by the DB2® that executes the SQL statement that refers to the special register. For a description of how the date is derived, see Datetime special registers.

Specifying CURRENT_TIME is equivalent to specifying CURRENT TIME.

Example: Display information about all project activities and include the current date and time in each row of the result.
  SELECT DSN8A10.PROJACT.*, CURRENT DATE, CURRENT TIME
    FROM DSN8A10.PROJACT;
1 Except for the case of a non-atomic multiple row INSERT or MERGE statement.