GetQueryBand Function | Application Programming Reference | Teradata Vantage - GetQueryBand - Advanced SQL Engine - Teradata Database

Application Programming Reference

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
cpn1571792172880.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1090
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

Returns the concatenated query band string for the current transaction, session, and profile.

Definition

REPLACE FUNCTION SYSLIB.GetQueryBand()
RETURNS VARCHAR(12304)CHARACTER SET UNICODE,
          .
          .
          .
;

Usage Notes

The GetQueryBand function can be used in a SELECT statement and an input parameter for a table function.

This function is 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.

Return Value

The GetQueryBand function returns the concatenated transaction, session, and profile query bands.

Example: Using GetQueryBand

SELECT GetQueryBand();
 *** Query completed. One row found. One column returned.
 *** Total elapsed time was 1 second.
GetQueryBand()
-------------------------------------------------------------------
=S> a=1;b=2;c=3;d=4;

Related Topics

For information on setting the query band for a session or transaction, see SET QUERY_BAND in Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.

For information on setting a profile query band, see CREATE PROFILE in Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.