Example: Casting Concatenated Character Literals

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

In the following example, two concatenated character literals are cast as PERIOD(TIMESTAMP(2)). The output is adjusted according to the current session time zone during display. Assume the current session time zone displacement is INTERVAL -'08:00' HOUR TO MINUTE and the format derived from SDF is 'YYYY-MM-DDBHH:MI:SS.S(2)Z'.

SELECT CAST('(''2005-02-02 12:12:12.34+08:00'', ' ||
       '''2006-02-03 12:12:12.34+08:00'')'
       AS PERIOD(TIMESTAMP(2)));

The following PERIOD(TIMESTAMP(2)) value is returned:

('2005-02-01 20:12:12.34', '2006-02-02 20:12:12.34')