FORMAT
Purpose
Returns the declared format for the named expression.
Syntax
where:
Syntax element … |
Specifies … |
expression |
the expression for which the FORMAT is to be reported. |
ANSI Compliance
This is a Teradata extension to the ANSI SQL:2011 standard.
Result Type and Attributes
FORMAT returns a CHAR(n) character string of up to 30 characters. The result type, character set, format, and title for FORMAT appear in the following table.
Data Type |
Format |
Title |
CHAR(n) CHARACTER SET UNICODE |
X(30) |
Format(named_expression) |
For information on data type default formats, see “Data Type Formats and Format Phrases” in SQL Data Types and Literals.
Example
The following statement requests the format of the Salary column in the Employee table.
SELECT FORMAT(Employee.Salary);
The result is the following.
Format(Salary)
------------------------------
ZZZ,ZZ9.99