Special registers that the BMC AMI Utilities SQL language supports
CURRENT DATE
The CURRENT DATE special register specifies a date that is based on a reading of the extended time-of-day (TOD) clock when the SQL statement is executed for a particular row of a table. The TOD clock value is then converted to local time, using the current time zone defined to the IBM z/OS system.
If, in a single statement, you use CURRENT DATE more than once or use it with CURRENT TIME or CURRENT TIMESTAMP, all corresponding values are based on a single clock reading.
Specifying CURRENT_DATE is equivalent to specifying CURRENT DATE.
CURRENT TIME
The CURRENT TIME special register specifies a time that is based on a reading of the extended time-of day (TOD) clock when the SQL statement is executed for a particular row of a table. The TOD clock value is then converted to local time, using the current time zone defined to the IBM z/OS system..
If, in a single statement, you use CURRENT DATE more than once or use it with CURRENT TIME or CURRENT TIMESTAMP, all corresponding values are based on a single clock reading.
Specifying CURRENT_TIME is equivalent to specifying CURRENT TIME.
CURRENT TIMESTAMP(n)
The CURRENT TIMESTAMP special register specifies a timestamp that is based on a reading of the extended time-of-day (TOD) clock when the SQL statement is executed for a particular row of a table. The TOD clock value is then converted to local time, using the current time defined to the IBM z/OS system.
Specifying CURRENT_TIMESTAMP is equivalent to specifying CURRENT TIMESTAMP.
Specifying (n) generates a timestamp with n precision. Valid values for n are 0 through 12. The default is 6.
CURRENT TIMEZONE
The CURRENT TIME ZONE special register specifies a value that contains the difference between UTC and local time. The data type is DECIMAL(6,0).
The difference between UTC and local time is represented by a time duration.
Subtracting CURRENT TIME ZONE from a local time converts the local time to UTC.
CURRENT TIMESTAMP(n) WITH TIME ZONE
The CURRENT TIMESTAMP WITH TIME ZONE special register specifies a timestamp that is based on a reading of the extended time-of-day (TOD) clock when the SQL statement is executed for a particular row of a table. The TOD clock value is then converted to local time using the implicit time zone defined in DSNHDECP; if DSNHDECP does not include a time-zone definition, the utility uses the current time zone defined to the IBM z/OS system.
Specifying (n) generates a timestamp with n precision. Valid values for n are 0 through 12. The default is 6.
Important
CURRENT TIMESTAMP might be referenced in a timestamp with time zone context (for example, when compared with a timestamp with a time zone column). In that case, the product bases the implicit time zone for CURRENT TIMESTAMP on the implicit time zone system parameter, which could be a different value from the CURRENT TIME ZONE special register.
Comments
Log in or register to comment.