17.10 - Example of Getting the Value of a Period Type - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)
void check_duration( PDT_HANDLE    *duration,
                     INTEGER       *result,
                     char           sqlstate[6])
{
    void * tmpBuf = 0;
    int bufSize = 0;
    int length;

    /* Get the value of the PERIOD(DATE) duration. */
    bufSize = SIZEOF_DATE * 2;
    tmpBuf = FNC_malloc(bufSize);
    FNC_GetInternalValue(*duration, tmpBuf, bufSize, &length); 

 ...

}