17.10 - Period Value Constructor Rules - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1211-171K
Language
English (United States)
The following rules apply to the Period value constructor:
  • The beginning bound must have a DateTime data type and, if an ending bound is specified, the data types of the beginning and ending bounds must be comparable.
  • The ending bound where the data type of the beginning bound is DATE or TIMESTAMP can be set to UNTIL_CHANGED.
  • If the ending bound is set to UNTIL_CLOSED, the following must be true:
    • The data type of the beginning bound value must be comparable with TIMESTAMP(6) WITH TIME ZONE.
    • The constructor is only valid in an assignment operation where the target column to which the result is assigned is a transaction-time column.
    • Because the only way to set the value of a transaction-time column is by using nontemporal DML, the constructor is only valid in a nontemporal DML statement.
  • The system reports an error if any of the following are true:
    • UNTIL_CHANGED is specified for the beginning bound.
    • The result beginning bound is greater than or equal to the result ending bound.
    • The data types of the beginning and ending bounds are not comparable.
    • UNTIL_CHANGED is specified for the ending bound and the data type of the beginning bound is TIME(n) [WITH TIME ZONE].
    • UNTIL_CLOSED is specified for the beginning bound.