17.10 - Example: Converting a PERIOD Data Type to Its Canonical Character String Representation - 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)

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