SET CURRENT QUERY ACCELERATION
The SET CURRENT QUERY ACCELERATION statement changes the value of the CURRENT QUERY ACCELERATION special register.
Invocation
This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.
Authorization
None required.
Syntax
Description
- NONE
- Specifies that no query acceleration is done.
- ENABLE
- Specifies that queries are accelerated only if Db2 determines that it is advantageous to do so. If an accelerator failure occurs while a query is running or if the accelerator returns an error, Db2 returns a negative SQLCODE to the application.
- ENABLE WITH FAILBACK
- Specifies that queries are accelerated only if Db2 determines that it is advantageous to do so. If the accelerator returns an error during the PREPARE or first OPEN for the query, Db2 executes the query without the accelerator. If the accelerator returns an error during a FETCH or a subsequent OPEN, Db2 returns the error to the user and does not execute the query.
- ELIGIBLE
- Specifies that queries are accelerated if they are eligible for acceleration. Db2 does not use cost information to determine whether to accelerate the queries. Queries that are not eligible for acceleration are executed by Db2. If an accelerator failure occurs while a query is running or if the accelerator returns an error, Db2 returns a negative SQLCODE to the application.
- ALL
- Specifies that queries are accelerated if they are eligible for acceleration. Db2 does not use cost information to determine whether to accelerate the queries. Queries that are not eligible for acceleration are not executed by Db2, and an SQL error is returned. If an accelerator failure occurs while a query is running or if the accelerator returns an error, Db2 returns a negative SQLCODE to the application.
- host-variable
A variable with a data type of CHAR or VARCHAR. The length must not exceed 255
bytes. Valid values are NONE, ENABLE, ENABLE WITH FAILBACK, ELIGIBLE, or ALL. If
host-variable has an associated indicator variable, the value of that indicator
variable must not indicate a null value. The value of host-variable must be left
justified and must be padded on the right with blanks.

Notes
The precedence order (lowest to highest) for setting the value of the special register is as follows:
- The QUERY_ACCELERATION subsystem parameter
- The QUERYACCELERATION bind option, if specified
- An explicit SET CURRENT QUERY ACCELERATION statement

Examples
The following statement sets the CURRENT QUERY ACCELERATION special register to NONE to indicate
that no acceleration is done.
SET CURRENT QUERY ACCELERATION NONE;