Query Band Examples - Teradata Preprocessor2

Teradata® Preprocessor2 for Embedded SQL Programmer Guide

Product
Teradata Preprocessor2
Release Number
17.00
Published
June 2020
Language
English (United States)
Last Update
2020-06-19
dita:mapPath
whb1544831946911.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2446
lifecycle
previous
Product Category
Teradata Tools and Utilities

To set the priority at 1 for a high workload in the current session:

EXEC SQL
  SET QUERY_BAND = 'priority=1;workload=high;' FOR SESSION;

To set the same values for the current transaction:

EXEC SQL
  SET QUERY_BAND = 'priority=1;workload=high;' FOR TRANSACTION;

To set the proxy user cluster with proxy role role1 for the current session:

EXEC SQL
  SET QUERY_BAND = 'PROXYUSER=cluser1; PROXYROLE=role1;' FOR SESSION;

To set the proxy user cluster with proxy role role1 for the current transaction:

EXEC SQL
  SET QUERY_BAND = 'PROXYUSER=cluser1; PROXYROLE=role1;' FOR TRANSACTION;

To add a name-value pair to the current session, use UPDATE in a second SET QUERY_BAND statement:

EXEC SQL
  SET QUERY_BAND = 'city=san diego;' FOR SESSION;
...

EXEC SQL
  SET QUERY_BAND = 'state=california;' UPDATE FOR SESSION;

To remove query banding from the current session:

EXEC SQL
  SET QUERY_BAND = NONE FOR SESSION;

To remove query banding from the current transaction:

EXEC SQL
  SET QUERY_BAND = NONE FOR TRANSACTION;