Examples | Numeric-to-Character Conversion | Teradata Vantage - 17.10 - Example: Converting an INTEGER Data Type to a Character - 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)

T1.Field1 has a numeric INTEGER data type with the default format ‘-(10)9’. The user has values such as 123456, with no values of over 999999. The values, defined as being in INTEGER format, are to be converted to CHAR(8).

The following example illustrates the Teradata syntax for performing this numeric-to-character conversion.

SELECT Field1(CHAR(8)) FROM T1;

returns ‘      123’ for the value 123456, where the result includes 5 leading pad characters and truncates significant digits.