17.05 - Example: Three-Dimensional VARRAY Type - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1144-175K
Language
English (United States)

These examples all create an Oracle-style 3-dimensional VARRAY type named seismic_cube based on the UDT measures_udt, which has the following SQL create text.

This example initializes all of its elements to nulls.

     CREATE TYPE seismic_cube AS
     VARRAY (1:5)(1:7)(1:20) OF measures_udt 
     DEFAULT NULL;

This example does not initialize its elements to nulls.

     CREATE TYPE seismic_cube AS
     VARRAY (1:5)(1:7)(1:20) OF measures_udt;

The next example defines an equivalent seismic_cube type, seismic_cube_2.

     CREATE TYPE seismic_cube_2 AS
     VARRAY (5)(7)(20) measures_udt;

The final example defines an equivalent seismic_cube type, seismic_cube_3.

     CREATE TYPE seismic_cube_3 AS
     VARRAY (1:5)(7)(1:20) measures_udt;