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™

FNC_SetArrayElements takes aryHandle, arrayInterval, newValue, nullIndicator, and length as input arguments and sets the value of the specified elements to NULL or to the value pointed to by newValue.

To define the buffer pointed to by newValue, use the C data type that maps to the underlying type of the element. For example, if the ARRAY type is defined with an element type of SQL INTEGER, you can define the buffer like this:

INTEGER value;
value = 2048;

If the underlying type of the element is a character string, and the newValue character string is shorter than the size defined for the type, FNC_SetArrayElements fills to the right with spaces.

Because character data types allow embedded null characters, do not include null termination characters in the value you pass in for the lengthargument.

To guarantee that the value you pass in for the length argument matches the length of the data type in Teradata Database, use the data type length macros defined in the sqltypes_td.h header file. For a list of the data type length macros, see FNC_SetStructuredAttribute.

Be sure to release allocated resources once you have processed the data.

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