UNTIL_CLOSED and UNTIL_CHANGED | ANSI Temporal Table Support | Teradata Vantage - 17.10 - UNTIL_CLOSED and UNTIL_CHANGED - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - ANSI Temporal Table Support

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)
UNTIL_CLOSED and UNTIL_CHANGED are special terms that are understood by Vantage under some circumstances to represent the ending bound of temporal time periods when the duration is indefinite, forever, or for which the end is an unspecified and unknown time in the future. The terms represent “the maximum system timestamp or date value.”
  • UNTIL_CLOSED is used with system-time periods, and represents TIMESTAMP '9999-12-31 23:59:59.999999+00:00'.
  • UNTIL_CHANGED is used with valid-time periods. Its value depends on the data type and precision of the valid-time column. If the type is DATE, UNTIL_CHANGED is the value DATE '9999-12-31'. If the type is TIMESTAMP, UNTIL_CHANGED is the value of TIMESTAMP '9999-12-31 23:59:59.999999+00:00', with precision and time zone matching that of the data type specified for the valid-time start and end columns.

Although these terms do not conform to current ANSI standards, the database supports the use of UNTIL_CHANGED for INSERTs and some queries of ANSI valid-time tables.

These four functions, also extensions to the ANSI standard, can be used in WHERE clauses when querying ANSI temporal tables in the database:

For more information on these functions, see Teradata Vantage™ - SQL Date and Time Functions and Expressions, B035-1211, and the discussion of Period data types in Teradata Vantage™ - Data Types and Literals, B035-1143.