Example: Creating Tables and Set Elements in a 3-D Array - 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™

Consider the following structured UDT:

CREATE TYPE measures_UDT AS(amplitude INTEGER,
                            phase     INTEGER,
                            frequency INTEGER);

The following statement creates a 3-D ARRAY data type named shots with an element type of measures_UDT.

CREATE TYPE shots AS measures_UDT ARRAY[-2:2][-5:5][-3:3];

The following statement creates a table with a column named shot_ary. The data type of the shot_ary column is shots, which is a 3-D ARRAY type.

CREATE TABLE seismic_table (id INTEGER, shot_ary shots);

The following query selects the value of an element from the 3-D array.

SELECT shot_ary[-1][1][3] FROM seismic_table;