Syntax - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantage™
void
FNC_GetQueryBand ( void  *QBandBuf,
                   int    BufSize,
                   int   *QBandLen )

Syntax Elements

QBandBuf
a pointer to a buffer that FNC_GetQueryBand (or FNC_GetQueryBandU) uses to return the query band. Before calling FNC_GetQueryBand (or FNC_GetQueryBandU), you must allocate the buffer pointed to by QBandBuf. The buffer must be large enough to return the query band plus a null terminator.
If the query band contains name-value pairs for the transaction, session, and/or profile, the function returns the concatenated transaction, session, and/or profile query band text.
For example, if the query band contains name-value pairs for the transaction, session, and profile, the function returns the concatenated transaction, session, and profile query band text as follows:
=T>  transaction_query_band  =S>  session_query_band  =P>  profile_query_band
Similarly, if the query band contains name-value pairs for the transaction and session, the function returns the concatenated transaction and session query band text as follows:
=T>  transaction_query_band  =S>  session_query_band
If the query band contains name-value pairs for the transaction only, the text contains:
=T>  transaction_query_band
If the query band contains name-value pairs for the session only, the text contains:
=S>  session_query_band
If the query band contains name-value pairs for the profile only, the text contains:
=P>  profile_query_band
If there are no name-value pairs for the transaction, session, or profile, the return string is 0 bytes.
BufSize
the size in bytes of the QBandBuf buffer.
The sqltypes_td.h header file provides the following constants that you can use:
#define FNC_MAXQUERYBANDSIZE 12304
#define FNC_MAXQUERYBANDSIZE_U 24608
where FNC_MAXQUERYBANDSIZE is the maximum query band size in bytes and FNC_MAXQUERYBANDSIZE_U is the maximum Unicode query band size in bytes.
QBandLen
the size in bytes of the returned query band. The length includes the size of any null termination characters.