Example Using FNC_GetStructuredAttributeInfo - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™
void getMap( UDT_HANDLE *geometriesUdt,
             INTEGER    *result,
             char        sqlstate[6])
{
    attribute_info_t attributeInfo;
    int nullIndicator;
    int length;
    int bufSize = 0;
    void * tmpBuf = 0;

    /* Get the attribute information for the first attribute. */
    FNC_GetStructuredAttributeInfo(*geometriesUdt, 0, 
         sizeof(attribute_info_t), &attributeInfo); 
    /* Get the value of the first attribute. */
    bufSize = attributeInfo.max_length;
    tmpBuf = FNC_malloc(bufSize);
    FNC_GetStructuredAttributeByNdx(*geometriesUdt, 0, tmpBuf, bufSize,
        &nullIndicator, &length);

    ...
}