17.10 - Example: Casting Concatenated Character Literals - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1143-171K
Language
English (United States)

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')