Example

Teradata Vantageā„¢ Data Types and Literals

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

Assume pt is a TIME(0) column in table t with a value of TIME '12:12:12' and the current session time zone displacement is INTERVAL -'08:00' HOUR TO MINUTE.

In the following example, a TIME(0) column is cast as PERIOD(TIME(4) WITH TIME ZONE). The result beginning bound is formed form the source (in UTC) with trailing zeros added to make the precision 4 and the current session time zone displacement. The result ending element is set to the result beginning bound plus INTERVAL '0.0001' SECOND.

The time zones of the result beginning and ending elements are the same.
SELECT CAST(pt AS PERIOD(TIME(4) WITH TIME ZONE)) FROM t;

Returns a PERIOD(TIME(4) WITH TIME ZONE) value as follows:

('12:12:12.0000-08:00', '12:12:12.0001-08:00')