UDTs are custom data types that allow you to model the structure and behavior of data that your application uses.
Teradata supports two types of UDTs:
| UDT Type | Description |
|---|---|
| Distinct | Based on single predefined data type such as INTEGER or VARCHAR. |
| Structured | Consists of one or more named attributes that can be predefined types or other UDTs. |
UDTs can be the data types of the following:
- Columns in table definitions
- Parameters and return values of scalar, aggregate, and table UDFs
Teradata also supports a form of structured UDT called a dynamic UDT. Instead of using a CREATE TYPE statement to define the UDT, use the NEW VARIANT_TYPE expression to declare an instance of a dynamic UDT and define the attributes of the UDT at run time.
Dynamic UDTs can only be the data types of input parameters to UDFs.