Usage Notes | OEXTEND | 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)

OEXTEND takes an array expression as an argument and allocates space for one or more new elements in the array.

IF you specify... THEN the method...
OEXTEND() appends a single NULL element to the ARRAY value. For a multidimensional (n-D) ARRAY, this is done in row-major order.
OEXTEND(num_spaces) appends n NULL elements to the ARRAY value, where n = num_spaces. For an n-D ARRAY, this is done in row-major order.
OEXTEND(num_spaces,index_value)

or

OEXTEND(num_spaces, array_bound)

appends n copies of the element indexed by either index_value or array_bound to the ARRAY value, where n = num_spaces. For an n-D ARRAY, this is done in row-major order.

The OEXTEND method with zero, one, or two arguments of INTEGER type is compatible with the Oracle EXTEND method, for one-dimensional ARRAY types. However, the empty set of parentheses required when OEXTEND is called with no arguments is a deviation from Oracle syntax.

OEXTEND returns an error in the following cases:
  • If array_expr is NULL.
  • If either index _value or array_bound is NULL.
  • If the number of elements appended by OEXTEND overflows the maximum size of the array.

If num_spaces is NULL, no error occurs, but no action is taken by OEXTEND.