About Defining Name-Value Pairs for Session and Transaction Query Bands - Teradata Database

Teradata Database Administration

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
Product Category
Software

About Defining Name-Value Pairs for Session and Transaction Query Bands

To assign values to a query band for a session or transaction, submit a SET QUERY_BAND statement. You can submit a SET QUERY_BAND = NONE FOR SESSION or NONE FOR TRANSACTION at any time to remove the query band. For the syntax and more extensive examples, see SQL Data Definition Language.

To set a query band for a profile, use a CREATE/MODIFY PROFILE request. For more information, see “About Defining Name-Value Pairs for Profile Query Bands” on page 231.

Example : Setting a Query Band For a Session

The following example sets a query band with two name:value pairs for the session.

     SET QUERY_BAND = 'org=Finance;report=Fin123;' FOR SESSION;

The pairs in the query band string are org=Finance and report=Fin123.

Example : Removing a Query Band From a Session

The following example removes the query band for the session.

     SET QUERY_BAND = NONE FOR SESSION;

The following request is equivalent.

     SET QUERY_BAND = '' FOR SESSION;

Example : Setting a Query Band for the Current Transaction

The following example sets a query band with two name:value pairs for the current transaction.

     SET QUERY_BAND = 'Document=XY1234;Universe=East;' FOR TRANSACTION;

The pairs in the query band string are Document=XY1234 and Universe=East.