Examples | ARRAY Data Type | Teradata Vantage - Example: Creating an ARRAY Data Type - Teradata Vantage - Analytics Database

SQL Data Types and Literals

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
uds1628112204571.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
exs1472253032394
lifecycle
latest
Product Category
Teradata Vantageā„¢

The following statement uses Teradata syntax to create a 1-D ARRAY type with 5 elements of type CHAR(10). All elements of the array are initialized to null.

CREATE TYPE phonenumbers_ary AS CHAR(10) ARRAY[5] DEFAULT NULL;

The following statement uses Oracle-compatible syntax to create a 1-D ARRAY type with 5 elements of type CHAR(10). All elements of the array are set to an uninitialized state.

CREATE TYPE phonenumbers_ary AS VARRAY(5) OF CHAR(10);

Consider the following structured UDT:

CREATE TYPE measures_UDT AS(amplitude INTEGER,
                            phase     INTEGER,
                            frequency INTEGER);
The following statement uses Teradata syntax to create a 3-D ARRAY type with elements of type measures_UDT. The scope of this array is composed of three dimensions:
  • Dimension one has a lower bound of 1 and an upper bound of 5.
  • Dimension two has a lower bound of 1 and an upper bound of 7.
  • Dimension three has a lower bound of 1 and an upper bound of 20.
    CREATE TYPE seismic_cube AS measures_UDT ARRAY [1:5][1:7][1:20];

The following statement uses Oracle-compatible syntax to create the same 3-D ARRAY type.

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