17.10 - Example: Set the Value of All Elements in the Array - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

In this example, FNC_SetArrayElements is called to set all of the elements to the value of the newVal argument.

/* This function sets all element values in the array. */
void setAllElements( 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 = 5;

    /* Set all elements in the array to the value of newVal. */
    FNC_SetArrayElements(*phone_ary, &arrayRange, (void*)newVal,
       nullIndicator, SIZEOF_CHARACTER_LATIN_WITH_NULL(10));