Example: UDT Expression Method - Advanced SQL Engine - Teradata Database

SQL Operators and User-Defined Functions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2023-04-27
dita:mapPath
qqu1556127655717.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1210
lifecycle
previous
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;