Allocating the newValues Buffer - 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
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

To define the buffer pointed to by newValues, use the C data type that maps to the underlying type of the element. Be sure to allocate the buffer for the number of elements that you are modifying. 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 newValues character string is shorter than the size defined for the type, FNC_SetArrayElementsWithMultiValues 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 newValuesBufSize argument.

To guarantee that the value you pass in for the newValuesBufSize argument matches the length of the data type, use the data type length macros defined in the sqltypes_td.h file when calculating the size of the newValues buffer. For a list of the data type length macros, see FNC_SetStructuredAttribute.

Be sure to release allocated resources after you process the data.