User-Defined Types
User-Defined Types (UDTs) allow the creation of custom data types that model the structure and behavior of data in applications. UDTs augment the Teradata Database with data types that have capabilities not offered by Teradata predefined (built-in) data types. A UDT can only exist on the Teradata Database server.
Teradata Database supports two types of UDTs: distinct and structured.
Example
Define 'Salary' as a Decimal (9,2), but with a function that prevents someone from entering a value of less than 20,000 or more than 2,000,000.
Example
If 'Address' is defined as a UDT with subfields for Street, Apartment, City, State, and Zip Code, Transform functions must be provided that convert input and output data into and from an 'Address' object. Input and output data as a string with all the fields concatenated, using fixed field lengths or a delimiter such as a comma between them.