1.4.4 CURRENT_TIMESTAMP value function

Organization of this subsection
(1) Function
(2) Format
(3) Rules

(1) Function

This function indicates the current time stamp.

(2) Format

CURRENT_TIMESTAMP value-function::= {CURRENT_TIMESTAMP [(fractional-second-precision)]|CURRENT TIMESTAMP [(fractional-second-precision)]}

(3) Rules

  1. If the CURRENT_TIMESTAMP value function is specified, HiRDB interprets that the time stamp data type (TIMESTAMP) has been specified.
  2. CURRENT_TIMESTAMP indicates the current time stamp. The CURRENT_TIMESTAMP function can be specified in the following items:
    • In a selection expression or a condition expression
    • In a column whose data type is time stamp or as an update or insertion value for a CHAR column whose length is 19, 22, 24, or 26 bytes
    If a fractional second precision p (p = 0, 2, 4, or 6) is specified, HiRDB returns a time stamp including a fractional second with p effective digits to the right of the decimal point. The default is a fractional second precision of p = 0.
    If CURRENT_TIMESTAMP is specified as an update or insertion value for a CHAR column, the current time stamp is converted into a predefined character string representation, and the result is used for updating or insertion.
    The table below shows the definition length of the CHAR column that can be specified when specifying CURRENT_TIMESTAMP as an update or insertion value.

    Table 1-11 Correspondence between the value of fractional second precision p and the definition length of CHAR when specifying CURRENT_TIMESTAMP as an update or insertion value

    Value of fractional second precision pDefinition length of CHAR
    019
    2, 4, or 620 + p
  3. Specifying CURRENT_TIMESTAMP multiple times in an SQL statement produces the same value. Specifying CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP in combination in an SQL statement produces datetime values representing the same point in time.