16.20 - 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
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
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); 

 ...

}