Usage Notes

Teradata Vantageā„¢ Data Types and Literals

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

OFIRST takes an array expression as an argument and returns the lowest subscript value in the ARRAY type. If array_expr is a one-dimensional ARRAY type, OFIRST returns an unsigned INTEGER value. If array_expr is a multidimensional ARRAY type, OFIRST returns a new instance of the predefined ARRAY type ArrayVec, containing the subscript information for the first element in the array. If the array is empty (all elements of the array are in an uninitialized state), then OFIRST returns NULL.

If array_expr is NULL, an error is returned.

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