Example: Set the Value of the Elements in Positions 1-3 of the Array - 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™

In this example, FNC_SetArrayElements is called to set the elements in positions 1-3 to the value of the newVal argument.

/* This function sets the values of a set of consecutive elements. */
void setMultiElement( ARRAY_HANDLE    *phone_ary,
                      CHARACTER_LATIN  newVal[10],
                      INTEGER         *result,
                      char             sqlstate[6])
{
    int nullIndicator;
    bounds_t arrayRange;
    nullIndicator = 0;
    arrayRange.lowerBound = 1;
    arrayRange.upperBound = 3;

    /* Set the elements in positions 1-3 to the value of newVal. */
    FNC_SetArrayElements(*phone_ary, &arrayRange, (void*)newVal,
       nullIndicator, SIZEOF_CHARACTER_LATIN_WITH_NULL(10));
    ...
}