IBM Books

SQL Reference

CURRENT EXPLAIN MODE

The CURRENT EXPLAIN MODE special register holds a CHAR(8) value which controls the behaviour of the Explain facility with respect to eligible dynamic SQL statements. This facility generates and inserts Explain information into the Explain tables (for more information see the Administration Guide). This information does not include the Explain snapshot.

The possible values are YES, NO, and EXPLAIN. (17)

YES
Enables the explain facility and causes explain information for a dynamic SQL statement to be captured when the statement is compiled.

EXPLAIN
Enables the facility like YES, however, the dynamic statements are not executed.

NO
Disables the Explain facility.

The initial value is NO.

Its value can be changed by the SET CURRENT EXPLAIN MODE statement (see SET CURRENT EXPLAIN MODE for information on this statement).

The CURRENT EXPLAIN MODE and CURRENT EXPLAIN SNAPSHOT special register values interact when the Explain facility is invoked (see Table 108 for details). The CURRENT EXPLAIN MODE special register also interacts with the EXPLAIN bind option (see Table 109 for details).

Example: Set the host variable EXPL_MODE (char(8)) to the value currently in the CURRENT EXPLAIN MODE special register.

       VALUES CURRENT EXPLAIN MODE
         INTO :EXPL_MODE

Footnotes:

(17) For static SQL, the EXPLAIN bind option provides the same control. In the case of the PREP and BIND commands, the EXPLAIN option values are: YES, NO and ALL.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]