Query Banding Teradata Database Feature
Available with the V12.0 Teradata Database, the query banding feature provides a user-defined query band expression that is set for every SQL session connected by the Teradata PT driver. A query band expression is a set of name-value pairs that identify a query’s originating source. In the expression, each name-value pair is separated by a semicolon and the expression ends with a semicolon. The following is an example of a valid query band expression:
If the TD_QUERY_BAND_SESS_INFO is set, the following request will be sent by every SQL session connected by the Teradata PT driver:
SET QUERY_BAND =’<User-Defined Query Band Expression>’ FOR SESSION;
Setting the TD_QUERY_BAND_SESS_INFO attribute in jobs running against non‑supported versions of the Teradata Database causes a non-fatal error. No error code is returned to the user during initiation and the job is allowed to proceed. The log table will not be dropped at the end of the job and the TD_Evt_ExitCode event returns a warning value of four instead of the normal success value of zero if queried. In this case, error information can be found in the trace file.