Usage Notes - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
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.