Example: Casting Concatenated Character Literals - Teradata Vantage - Analytics Database

SQL Data Types and Literals

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantageā„¢

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