Period Data Types Usage Notes - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Storage

A PERIOD(TIME[(n)] WITH TIME ZONE) is a fixed length data type and is saved as two TIME WITH TIME ZONE values.

Element Type Field Size in Bytes Maximum Size in Bytes in the Row
TIME(n) WITH TIME ZONE 16 16

External Representation of PERIOD(TIME WITH TIME ZONE)

In field mode, Vantage returns PERIOD(TIME WITH TIME ZONE) data as character data.

Assume L is the maximum length of the formatted character string for the format associated with this Period data type. The resulting character string contains two strings representing the beginning and ending bounds of the period value expression, each up to length L , and each enclosed in apostrophes ('), separated by comma and a space (,), and then enclosed within a left and right parenthesis [( )]. Thus, the maximum length of the resulting character string is 2* L +8.

For modes other than field mode, and for input data, the external representation of PERIOD(TIME WITH TIME ZONE) consists of two consecutive time with time zone values. Each time value consists of the following fields, returned in the specified order:
  1. Second

    4-byte, signed integer flipped to client form, representing the number of seconds as a scaled decimal (for example, 12.56 seconds is returned as 12560000).

  2. Hour

    1 unsigned byte representing the number of hours.

  3. Minute

    1 unsigned byte representing the number of minutes.

  4. Time Zone Hour

    1 unsigned byte representing the hours portion of the time zone displacement with whether the displacement is + or -.

    A value of 16 represents 0 hours. A value less than 16 represents a negative time zone displacement for the specified hours. That is, if this is 10, the time zone is displaced by -10 hours. If greater than 16, this value specifies a positive time zone displacement of (Time Zone Hour - 16) hours, That is, a value of 20 implies a +4 hour displacement.

  5. Time Zone Minute

    1 unsigned byte representing the minute portion of the time zone displacement.

Restrictions

A primary index column or partitioning column cannot be a column that has a Period data type.