Usage Notes - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

You can call FNC_GetArrayElements first to get multiple values from an ARRAY and a corresponding NullBitVector. Then you can optionally modify both of these structures and use FNC_SetArrayElementsWithMultiValues to update the same range of elements in a different ARRAY that has the same ARRAY data type.

Alternatively, you can create your own newValues buffer and update an ARRAY using the values from the buffer as follows:

  1. Allocate the newValues buffer to be the size corresponding to the number of elements to be modified, based on the range specified in the arrayInterval input parameter. See Allocating the newValues Buffer.
  2. Fill the buffer with the desired element value for each element in the specified range, in row-major order. See Filling the newValues Buffer. You must allocate, initialize and set a corresponding NullBitVector to accompany the values in the newValues buffer. See Setting the NullBitVector. Then you can use FNC_SetArrayElementsWithMultiValues to update a range of values all at once.

This function provides performance benefits by allowing you to update potentially large sections of an ARRAY with few FNC calls. Otherwise, you would need to call FNC_SetArrayElements multiple times in order to set several individual elements to different new values.

For more information, see Setting the Value of Array Elements.