15.00 - TEMPORAL_TIMESTAMP - Teradata Database

Teradata Database SQL Functions, Operators, Expressions, and Predicates

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1145-015K
Language
English (United States)

TEMPORAL_TIMESTAMP

Purpose  

Returns the current transaction timestamp where the evaluation is based on the session time zone.

Syntax  

where:

 

Syntax element …

Specifies …

precision

an optional precision range for the returned timestamp value.

The valid range is 0 through 6, inclusive.

The default is 6.

Result Type and Attributes

The result data type, format, and title for TEMPORAL_TIMESTAMP are as follows:

 

Data Type

Format

Title

TIMESTAMP(n) WITH TIME ZONE, where n is the same as the precision argument or 6 if omitted

Default format for the TIMESTAMP WITH TIME ZONE type.

For details on default formats, see “Data Type Formats and Format Phrases” in SQL Data Types and Literals.

Timestamp

Usage Notes  

The value of TEMPORAL_TIMESTAMP is the same for all requests submitted in a single transaction.

The system uses the session time zone to evaluate TEMPORAL_TIMESTAMP.

When TEMPORAL_TIMESTAMP appears in a CHECK constraint or DEFAULT clause, the result value is evaluated when the request applies the CHECK constraint (during an insert or update) or when the request uses the DEFAULT value for a given column.

For information on using TEMPORAL_TIMESTAMP with temporal tables, see ANSI Temporal Table Support and Temporal Table Support.

Precision

The seconds precision of the result of TEMPORAL_TIMESTAMP is limited to hundredths of a second. TEMPORAL_TIMESTAMP returns zeros for any digits to the right of the two most significant digits in the fractional portion of seconds.