Example: Creating a Structured UDT from Predefined Data Types - Analytics Database - Teradata Vantage

SQL Data Definition Language Syntax and Examples

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-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

This example creates a structured UDT named person from four predefined data types and the structured UDT address, making it a 2-level nested type. The UDT is nested because the type address is a structured UDT having two attributes. Both attributes are predefined types, but if one or more had been a structured type, person would be a 3-level nested type.

    CREATE TYPE SYSUDTLIB.person AS (
       ssn         CHARACTER(11), 
       first_name  VARCHAR(20),
       middle_name VARCHAR(20),
       last_name   VARCHAR(20),
       domicile    address ) 
    NOT FINAL;