Usage Notes | OLAST | Teradata Vantage - 17.10 - Usage Notes - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1143-171K
Language
English (United States)

OLAST takes an array expression as an argument and returns the highest subscript value with a populated element in the ARRAY type. This is different from the highest possible subscript value, as returned by the OLIMIT method. If array_expr is a one-dimensional ARRAY type, OLAST returns an unsigned INTEGER value. If array_expr is a multidimensional ARRAY type, OLAST returns a new instance of the predefined ARRAY type ArrayVec, containing the subscript information. If the array is empty (all elements of the array are in an uninitialized state), then OLAST returns NULL.

If array_expr is NULL, an error is returned.

The OLAST method is compatible with the Oracle LAST method for one-dimensional ARRAY types. However, the empty set of parentheses required by Teradata syntax is a deviation from Oracle syntax.