UDT Types - Analytics Database - Teradata Vantage

Database Introduction

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-09-27
dita:mapPath
gtm1628096154303.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
dsm1472253642401
lifecycle
latest
Product Category
Teradata Vantageā„¢

Vantage supports the following UDT Types.

UDT Type Description Example
Distinct
  • Defined with CREATE TYPE statement.
  • Valid almost everywhere predefined types are valid.
  • Based on single predefined data type, such as INTEGER or VARCHAR.
UDT named euro based on DECIMAL(8,2) data type, for storing monetary data.
Structured
  • Defined with CREATE TYPE statement.
  • Valid almost everywhere predefined types are valid.
  • Collection of one or more fields (called attributes), each of which is defined as a predefined data type or other UDT. (You can nest UDTs.)
UDT named circle with x-coordinate, y-coordinate, and radius attributes.
Dynamic
  • Constructed at runtime from NEW VARIANT_TYPE expression.
  • Valid only as data type of input parameter to external UDF.

    External UDF can have at most eight input parameters with dynamic UDF data types.

  • Significantly increases number of input arguments you can pass to external UDF.
 

Distinct and structured UDTs can define methods that operate on the UDT. For example, a distinct UDT named euro can define a method that converts the value to a US dollar amount. Similarly, a structured UDT named circle can define a method that computes the area of the circle using the radius attribute.