Example: Converting a PERIOD Data Type to Its Canonical Character String Representation

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 pts is a PERIOD(TIMESTAMP(2)) column in table t with a value of PERIOD '(2005-02-02 12:12:12.34, 2006-02-03 12:12:12.34)'.

In the following example, a PERIOD(TIMESTAMP(2)) column is cast as CHARACTER(52) using the CAST function.

SELECT CAST(pts AS CHARACTER(52)) FROM t;

The following is returned:

('2005-02-02 12:12:12.34', '2006-02-03 12:12:12.34')