SET QUERY_BAND Statement | Teradata Vantage - SET QUERY_BAND Syntax Rules - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™
The following rules apply to the syntax of SET QUERY_BAND statements.
  • Each name:value pair must be separated from other name:value pairs by a SEMICOLON character.

    No other separator is valid.

  • The entire string of name:value pairs for a given SET QUERY_BAND request must be delimited by APOSTROPHE characters.
  • The value component of a name:value pair can contain an = (equals) sign, but the name component cannot.
  • Pair names cannot be repeated within a query band definition.
  • When pad characters are located in the following positions, Vantage considers them to be extraneous and removes them from a query band string.
    • At the beginning or end of the query band string
    • Before and after an EQUALS SIGN (=) character
    • Before and after a SEMICOLON (;) character
  • Parameterized requests are supported for the ODBC and JDBC APIs for SET QUERY_BAND … FOR TRANSACTION only.

    Query bands support the QUESTION MARK (?) parameter marker for parameterized requests submitted by the ODBC and JDBC APIs.

    For example, the following SQL procedure definition is not valid because it attempts to pass a query band as the parameterized value :qbin.

    CREATE PROCEDURE setqbmsr(IN qbin VARCHAR(60))
     BEGIN
      SET QUERY_BAND = :qbin FOR TRANSACTION;
      INSERT INTO abc (1,2);
     END;