Example: Methods and Functions - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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

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

Vantage runs 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'.