SET CURRENT EXPLAIN MODE statement
The SET CURRENT EXPLAIN MODE statement assigns a value to the CURRENT EXPLAIN MODE special register.
Invocation for SET CURRENT EXPLAIN MODE
This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.
Authorization for SET CURRENT EXPLAIN MODE
None required.
Syntax for SET CURRENT EXPLAIN MODE
Description for SET CURRENT EXPLAIN MODE
This statement replaces the value of the CURRENT EXPLAIN MODE special register with the value of
the specified keyword or host variable.
- NO
- Specifies that no EXPLAIN information is captured. NO is the initial value of the EXPLAIN MODE special register.
- YES
- Enables the EXPLAIN facility and causes EXPLAIN information to be inserted into the EXPLAIN tables for eligible dynamic SQL statements after the statement is prepared and executed. All dynamic SQL statements are compiled and executed normally.
- EXPLAIN
- Enables the EXPLAIN facility and causes EXPLAIN information to be captured for any eligible dynamic SQL statement after the statement is prepared. This setting behaves similarly to YES, however, dynamic statements, except for SET statements, are not executed.
- host-variable
- host-variable must be a CHAR or VARCHAR value and must be NO, YES, or EXPLAIN. Leading blanks are not allowed. All input values must be uppercase, must be left justified within the host variable, and must be padded on the right with blanks if the length of the value is less than the length of the host variable.
For values YES and EXPLAIN, prepared statements are not saved into the dynamic statement cache.
Examples for SET CURRENT EXPLAIN MODE
Example 1: The following statement sets the CURRENT EXPLAIN MODE special register, so that
EXPLAIN information will be captured for any subsequent eligible dynamic SQL statements during
execution.
SET CURRENT EXPLAIN MODE = YES;