16.10 - Multidimensional (n-D) ARRAY Data Type - Teradata Database

Teradata Database SQL Data Types and Literals

Teradata Database
June 2017
Programming Reference

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 details, 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 details on referencing an ARRAY element, see “ARRAY Functions and Operators” in SQL Functions, Operators, Expressions, and Predicates.

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

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.