Example: Methods and Functions - Analytics Database - Teradata Vantage

SQL Operators and User-Defined Functions

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
2024-04-05
dita:mapPath
xub1628111590556.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
drp1544241916620
lifecycle
latest
Product Category
Teradata Vantage™

The following statement uses the built-in constructor function and mutator methods to return a new instance of the address UDT and insert it into the european_sales table:

INSERT INTO european_sales 
VALUES (101, address().street('210 Stanton').zip('76543'), 500);

Vantage executes the UDT expression in the following order:

Step Invocation Result
1 address() constructor function Default UDT instance
2 mutator method for street UDT instance with street attribute set to '210 Stanton'
3 mutator method for zip UDT instance with zip attribute set to '76543'

The final result of the UDT expression is an instance of the address UDT with the street attribute set to '210 Stanton' and the zip attribute set to '76543'.