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;