Example: UDT and a One-Dimensional ARRAY Type - 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

This example first creates a structured UDT named employee and then creates ARRAY types based on the UDT using both Teradata-style and Oracle-style syntax.

     CREATE TYPE employee AS (
       first_name  CHARACTER(10),
       last_name   CHARACTER(10),
       employee_id INTEGER)
       …;

The first example creates the ARRAY type structudt_ary , which is based on employee, using Teradata-style syntax.

     CREATE TYPE structudt_ary AS 
     employee ARRAY[20];

The next example creates the same ARRAY type as a VARRAY type using Oracle-style syntax.

     CREATE TYPE structudt_ary AS 
     VARRAY(20) OF employee;