Defining Functions that Use UDT Types | Teradata Vantage - Defining Functions that Use UDT Types - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantageā„¢

UDTs are custom data types that allow you to model the structure and behavior of data that your application deals with.

Teradata supports two types of UDTs: distinct types and structured types. A distinct type is based on a single predefined data type such as INTEGER or VARCHAR. A structured type consists of one or more named attributes that can be predefined types or other UDTs.

In addition to specifying distinct and structured UDTs as the data types of columns in table definitions, you can specify them as the data types of scalar, aggregate, and table UDF parameters and return values.

Teradata also supports a form of structured UDT called dynamic UDT. Instead of using a CREATE TYPE statement to define the UDT, like you use to define a distinct or structured type, you use the NEW VARIANT_TYPE expression to declare an instance of a dynamic UDT and define the attributes of the UDT at run time.

You can specify a dynamic UDT as the data type of input parameters to UDFs. They cannot appear anywhere else.