GetQueryBandPairs Function | Application Programming Reference | Teradata Vantage - GetQueryBandPairs - Teradata Vantage - Analytics Database

Application Programming Reference

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
qld1628112131956.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
ajo1472244909562
lifecycle
latest
Product Category
Teradata Vantageā„¢

Returns the name and value pairs in the query band.

Syntax

GetQueryBandPairs are two overloaded table functions. One requires the query band string to be passed in; the other uses internal calls to retrieve the query band.

REPLACE FUNCTION SYSLIB.GetQueryBandPairs (
  SearchType SMALLINT
) RETURNS TABLE (
    QBName  VARCHAR(129) CHARACTER SET UNICODE,
    QBValue VARCHAR(257) CHARACTER SET UNICODE
  )
  ...
;
REPLACE FUNCTION SYSLIB.GetQueryBandPairs (
  QueryBandIn  TD_ANYTYPE,
  SearchType   SMALLINT
) RETURNS TABLE (
    QBName  VARCHAR(129) CHARACTER SET UNICODE,
    QBValue VARCHAR(257) CHARACTER SET UNICODE
  )
  ...
;

Syntax Elements

SearchType
Search type:
  • 0 = Return the name-value pairs in both transaction and session query bands are returned.

    If the same name occurs in both the transaction and the session query bands, the value for the transaction query band is returned.

  • 1 = Return only the name-value pairs in the transaction query band.
  • 2 = Return only the name-value pairs in the session query band.
  • 3 = Return only the name-value pairs in the profile query band.
QueryBandIn
Query band string.
QBName
Name of the query band.
QBValue
Value of the query band.

Usage Notes

Both functions are created in the SYSLIB database by the DEM DIP script. EXECUTE privileges are granted to PUBLIC by default. For more information, see Requirements for Using the API.

Example: Using GetQueryBandPairs

The following example shows how to call the GetQueryBandPairs function.

SELECT * FROM TABLE(GetQueryBandPairs(0)) AS t1;

Result:

 *** Query completed. 3 rows found. 2 columns returned.
 *** Total elapsed time was 1 second.
QBName    QBValue
--------- ---------------
ORG       FINANCE
JOB       ENDOFMONTH
JOBID      193858

Example: Using GetQueryBandPairs with MonitorQueryBand as Input

The following example shows how to call the GetQueryBandPairs function using the MonitorQueryBand function as input.

SELECT * FROM TABLE(GetQueryBandPairs(MonitorQueryBand(1, 103, 16383), 0)) AS t1;

Result:

 *** Query completed. 3 rows found. 2 columns returned.
 *** Total elapsed time was 1 second.
QBName     QBValue
---------- ---------------
ORG       FINANCE
JOB       ENDOFMONTH
JOBID      193858