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:
- IS NOT UNTIL_CLOSED
- IS UNTIL_CHANGED
- IS NOT UNTIL_CHANGED
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.