Defining Functions that Use UDT Types | Teradata Vantage - Defining Functions that Use UDT Types - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
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.