Example: UDT Expression Method - 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™

Consider the following statement that creates a structured UDT named address :

CREATE TYPE address
AS (street VARCHAR(20)
   ,zip CHAR(5))
NOT FINAL;

The following statement creates a table that defines an address column named location :

CREATE TABLE european_sales
  (region INTEGER
  ,location address
  ,sales DECIMAL(8,2));

The following statement invokes the zip observer method to retrieve the value of each zip attribute in the location column:

SELECT location.zip() FROM european_sales;