Usage Notes - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantageā„¢

FNC_GetArrayElements takes ary_handle, arrayInterval, returnValueBufSize, and nullBitVecBufSize as input arguments and returns:

  • The values of the requested elements, specified by arrayInterval, in row-major order. The values are placed in the returnValue buffer.
  • A NullBitVector where the bits of nullBitVec that correspond to the range of requested elements are set to indicate whether the elements are present and not NULL, or present but set to NULL.
  • The size in bytes of the value that is returned in returnValue. The size is placed in the length output parameter.

The range of elements requested starts with the first element specified in the arrayInterval string and ends with the last element specified. Any elements that are NULL will have space returned which is of the size of the element type, but will be zero-filled. They will also have their presence bit set to 0 in nullBitVec. If any element in the requested range is uninitialized, an error is returned to the user.

You can check the value of the relevant presence bits in nullBitVec by calling FNC_CheckNullBitVector or FNC_CheckNullBitVectorByElemIndex. You can then use this information to interpret the elements returned by FNC_GetArrayElements.

For more information, see FNC_CheckNullBitVector, FNC_CheckNullBitVectorByElemIndex, and Accessing the Value of Array Elements.