The query band is a set of user-defined name-value pairs used to uniquely identify a session or transaction in the Teradata Database. Uses of the query band to tag a session or transaction include the following:
- Grouping requests into arbitrary jobs for accounting and control purposes
- Asserting a proxy user or proxy role for a trusted session
- Debugging performance problems
- Defining system variables
Examples of the query band definition:
If query band definition is | Because it |
---|---|
valid |
follows syntactical rules: Job=payroll;Userid=aa1000000;Jobsession=1122; |
invalid |
uses the = character in the name: Job=payroll;User=id=aa1000000;Jobsession=1122; |
The table here lists what happens in certain query band scenarios.
Scenario | Description |
---|---|
The query band contains
|
Returns an error |
The query band exceeds 2048 characters, not counting white space padding | Returns an error |
The query band definition repeats a name in a name-value pair | Returns an error |
A name-value pair does not end with a ; | Returns an error |
The name is more than 128 characters | Returns an error |
The value is more than 256 characters | Returns an error |
The value is 0 characters | Allows the query band definition, but does not pass a value for the associated name |
For detailed information about the query band feature using valid key-value pair, see Teradata® Database SQL Data Definition Language - Syntax and Examples, B035-1144.