INTERVAL-to-UDT Conversion
Purpose
Converts interval data to UDT data.
CAST Syntax
where:
Syntax element … |
Specifies … |
interval_expression |
an interval expression to be cast to a UDT. |
UDT_data_definition |
the UDT type to which interval_expression is to be converted. |
ANSI Compliance
This is ANSI SQL:2011 compliant.
As an extension to ANSI, CAST permits the use of data attribute phrases such as FORMAT.
Usage Notes
Explicit INTERVAL-to-UDT conversion using Teradata conversion syntax is not supported.
Data type conversions involving UDTs require appropriate cast definitions for the UDTs. To define a cast for a UDT, use the CREATE CAST statement. For more information on CREATE CAST, see SQL Data Definition Language.
Implicit INTERVAL-to-UDT Conversion
Performing an implicit data type conversion requires a cast definition (see “Usage Notes” on page 662) that specifies the following:
This INTERVAL data type … |
Belongs to this INTERVAL family … |
|
Year-Month |
|
Day-Time |
The source data type of the cast definition does not have to be an exact match to the source of the implicit type conversion.
Teradata Database performs implicit INTERVAL-to-UDT conversions for the following operations:
Related Topics
For details on data types and data attributes, see SQL Data Types and Literals.