Usage Notes | ARRAY_GET | Teradata Vantage - Usage Notes - 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™

ARRAY_GET takes an array expression as an argument and returns the element value in array_expr that corresponds to the position specified by array_index.

If array_expr is a one-dimensional ARRAY type, the index of the element to be located is defined by an INTEGER or an ArrayVec type that must be within the defined boundaries of array_expr.

If array_expr is a multidimensional ARRAY type, the index of the element to be located is defined using the predefined array type ArrayVec. For more information on the ArrayVec type, see “ARRAY Scope Reference”. The number of dimensions defined by ArrayVec must be between 2 and 5 (the maximum number of dimensions supported) and must correspond to the number of dimensions in array_expr. The values for each dimension are separated by a comma and they must be within the defined boundaries of array_expr.

If the value of array_index references an element of the ARRAY which is in an uninitialized state, an error is returned. To avoid referencing an element of the ARRAY that is uninitialized, set any uninitialized elements to NULL. You can do this with the OEXTEND method. See OEXTEND.

If array_expr is NULL, the function returns NULL.