17.10 - Example: Converting Salaries - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Data Types and Literals

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

Based on the following description of Salary, data is converted as illustrated in the following table (Δ = pad character):

Salary (DECIMAL(8,2), FORMAT '$$$,$$9.99')
Data Conversion Result
20000.00 Salary (CHAR(10)) '$20,000.00'
9000.00 Salary (CHAR(10)) 'Δ $9,000.00'
20000.00 Salary (FORMAT'9(5)') (CHAR (5)) '20000'
9000.00 CAST (Salary AS CHAR(10)) '$9,000.00Δ '

The resultant character string is either extended with pad characters or truncated to conform to the given character description.