expression ( data_type_list )
- expression
- The data expression to be converted to the new definition defined by data_type_list
- data_type_list
- A data type declaration or data attributes or both.
This syntax is called Teradata conversion syntax, and is non-ANSI. Using Teradata conversion syntax is strongly discouraged. It is a Teradata extension to the ANSI SQL:2011 standard and is retained only for backward compatibility with existing applications. You should always use the CAST function to perform conversions in new applications to ensure ANSI compatibility.
For example, in the following SELECT statement, a TITLE phrase overrides the default heading (the column name) for EmpNo, and a FORMAT phrase modifies the display format defined for Salary data in the CREATE TABLE statement.
SELECT EmpNo (TITLE 'Emp#'), Salary (FORMAT '$$$,$$9.99') FROM Employee;
Restrictions apply to the data types that Teradata conversion syntax supports. For example, you cannot use Teradata conversion syntax to convert data to a UDT. For more information, see Teradata Vantageā¢ - SQL Functions, Expressions, and Predicates, B035-1145.