MonitorQueryBand Function | Application Programming Reference | Teradata Vantage - MonitorQueryBand - 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 concatenated query band string for the current transaction, session, and profile. If there is no concatenated query band, the function returns an empty string.

Syntax

REPLACE FUNCTION SYSLIB.MonitorQueryBand (
  HostId     SMALLINT,
  SessionNo  INTEGER,
  RunVprocNo SMALLINT)
  RETURNS VARCHAR(12304)CHARACTER SET UNICODE
  )
  ...
;

Syntax Elements

HostId
Logical ID of a host.
SessionNo
Number of the session to get the query band for.
RunVprocNo
PE vproc number where the session runs. This is obtained from the RunVprocNo field of a MONITOR SESSION response (see Group I Data Fields and JDBC ResultSet Columns).

Usage Notes

The privileges to use this function are not granted by default. The database administrator must explicitly grant the privilege to users that require it.

The MonitorQueryBand function provides similar functionality to a MONITOR QUERYBAND request. For more information about this interface, see MONITOR QUERYBAND.

Example: Using MonitorQueryBand

SELECT MonitorQueryBand (1, 1003, 16382);

Result:

* * * Query completed. One row found. One column returned.
* * * Total elapsed time was 5 seconds.
MonitorQueryBand (1, 1003, 16382)
---------------------------------
=T= job=x1; =S= org=Finance; report=Fin123;

Related Information

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.