Examples | Numeric-to-Character Conversion | Teradata Vantage - Example: Converting an INTEGER Data Type to a Character - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
tpf1598412463935.ditamap
dita:ditavalPath
tpf1598412463935.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantage™

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.