Formatting Characters | Data Types and Literals | Teradata Vantage - Formatting Characters - 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ā„¢

Use the following characters in the FORMAT phrase to control formatting.

Character Meaning
X

X(n)

The letter X formats the display of character data. Each X represents one character. The data is returned in left-to-right order.

For example, if a column is defined as FORMAT 'X', only the first (leftmost) character of each field value is displayed.

Multiple character positions can be defined either by using the (n) notation, where n defines the length of the string, or by entering the equivalent number of X characters.

Character strings are padded or truncated on the right when they are shorter or longer than the positions defined in the FORMAT phrase.