Period Value Constructor Rules - Advanced SQL Engine - Teradata Database

SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
dzx1591742169550.ditamap
dita:ditavalPath
dzx1591742169550.ditaval
dita:id
B035-1211
lifecycle
previous
Product Category
Teradata Vantageā„¢
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.