Function Context Parameter - 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™

As discussed in Aggregate Function Parameter List, the aggregate UDF parameter list includes a pointer to an FNC_Context_t function context structure, which is defined as:

struct FNC_Context_t {
    int         version;
    FNC_flags_t flags;
    void        *interim1;
    int         intrm1_length;
    void        *interim2;
    int         intrm2_length;
    long        group_count;
    long        window_size;
    long        pre_window;
    long        post_window;
} FNC_Context_t;

The function should treat the structure as read only, and must never change any of its values. The structure has four members that are used for intermediate storage in aggregate functions.

Member … Specifies …
interim1 a pointer to the aggregate storage area in which the function saves intermediate results.
interim2 a pointer to an intermediate storage area to combine with the interim1 storage area when the value of aggregation phase is AGR_COMBINE.
intrm1_length the length of interim1.
intrm2_length the length of interim2.