Multidimensional (n-D) ARRAY Data Type | Teradata Vantage - Multidimensional (n-D) ARRAY Data Type - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantage™

An n-D ARRAY is a mapping from integer coordinates to an element type. The n-D ARRAY type is defined as a variable-length ordered list of values of the same data type. It has 2-5 dimensions, with a maximum number of values for each dimension, which you specify when you create the ARRAY type.

You define an n-D ARRAY type with a pair of lower and upper boundaries [n:m] for each of its dimensions. Alternatively, you can specify a single value [n] to signify the maximum size of a dimension, which implicitly defines the lower bound of the dimension to be 1. For more information, see Creating an ARRAY Data Type.

You can access each element value in an n-D ARRAY type using numeric index values for each dimension. For more information on referencing an ARRAY element, see “ARRAY Functions and Operators” in Teradata Vantage™ - SQL Functions, Expressions, and Predicates, B035-1145.

The figure below shows the constituents of a 3-D ARRAY data type.


3-D ARRAY data type constituents

Teradata Database stores the element values of an n-D ARRAY in row-major order. Row-major means that the first dimension, which is leftmost in the scope specification, is the most major dimension, and as you move toward the last dimension, the dimensions become less and less major.