1.5.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
    • As a value to be updated or inserted into a time stamp data type column
    • As a value to be updated or inserted into a CHAR string of length 19, 22, 24, or 26 bytes (or a CHAR string of length 38, 44, 48, or 52 bytes when UTF16 is specified as the character set)
    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 lists the defined lengths of the CHAR column that can be specified when specifying CURRENT_TIMESTAMP as an update or insertion value.

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

    Value of fractional second precision pDefined length of CHAR
    Default character set or a character set other than UTF-16UTF-16 character set
    01938
    2, 4, or 620 + p40 + p x 2
  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.