16.20 - Syntax - 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
FNC_GetQueryBandValue ( void            *QBandBuf,
                        FNC_QBSearch_et  SearchType 
                        void            *QBName,
                        void            *QBValue )
void *QBandBuf
A pointer to a buffer containing the query band, where the query band can be:
  • Returned by FNC_GetQueryBand
  • Retrieved from the DBC.DBQLogTbl.QueryBand column
  • Specified by the caller
FNC_QBSearch_et SearchType
Whether FNC_GetQueryBandValue (or FNC_GetQueryBandValueU) searches the transaction, session, and/or profile name-value pairs in the query band string for the name specified by QBName.
FNC_QBSearch_et is defined in sqltypes_td.h and includes the following values:
  • QB_FIRST specifies to return the value of the first name-value pair, where the name is specified by the QBName input argument. If the query band string contains name-value pairs for the transaction, session, and profile, FNC_GetQueryBandValue (or FNC_GetQueryBandValueU) searches the name-value pairs in the following order:
    • Transaction query band
    • Session query band
    • Profile query band
  • QB_TXN specifies to search the transaction name-value pairs in the query band and return the value that corresponds to the name specified by the QBName input argument.
  • QB_SESSION specifies to search the session name-value pairs in the query band and return the value that corresponds to the name specified by the QBName input argument.
  • QB_PROFILE specifies to search the profile name-value pairs in the query band and return the value that corresponds to the name specified by the QBName input argument.
void *QBName
The name in the name-value pair to return the value for.
void *QBValue
A pointer to a buffer in which FNC_GetQueryBandValue (or FNC_GetQueryBandValueU) returns the value corresponding to the name specified by QBName.
The buffer must be large enough to return the value plus a null terminator.