Example: Converting an INTEGER Data Type to a Character

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

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.