17.10 - Syntax - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)
FNC_SetArrayElements ( ARRAY_HANDLE     aryHandle,
                       bounds_t        *arrayInterval,
                       void            *newValue,
                       int              nullIndicator,
                       long             length  )

Syntax Elements

the handle to an ARRAY type that is defined to be a return value to a UDF or UDM, or an INOUT or OUT parameter to an external stored procedure.
an array of bounds_t structures that provides the index to the set of ARRAY elements that will be modified to NULL or newValue.
For a 1-D ARRAY, the index to the set of elements is provided in the first cell of the arrayInterval array. If the ARRAY type is n-D, then subsequent dimension information is placed in cells 2-5 as needed.
The bounds_t structure is defined in sqltypes_td.h as:
typedef struct bounds_t {
   int lowerBound;
   int upperBound;
} bounds_t;
The value of lowerBound specifies the first value in the given dimension to be modified, and upperBound specifies the last value in the given dimension to be modified.
This range of elements must be sequential for a 1-D ARRAY, and must be specified as a slice or rectangle of elements for an n-D ARRAY. The boundaries (lower and upper) for each dimension must be within the limits defined for the ARRAY type.
a pointer to a buffer that FNC_SetArrayElements uses to set the values of the affected elements.
whether to set the requested elements to NULL:
  • If nullIndicator is -1, then the elements are set to NULL.
  • If nullIndicator is 0, then the elements are set to the value pointed to by newValue.
the total size in bytes of the new value.