DB2 10.5 for Linux, UNIX, and Windows

EXPLAIN_DIAGNOSTIC table

The EXPLAIN_DIAGNOSTIC table contains an entry for each diagnostic message produced for a particular instance of an explained statement in the EXPLAIN_STATEMENT table.

The EXPLAIN_GET_MSGS table function queries the EXPLAIN_DIAGNOSTIC and EXPLAIN_DIAGNOSTIC_DATA Explain tables and returns formatted messages.

Table 1. EXPLAIN_DIAGNOSTIC Table. PK means that the column is part of a primary key; FK means that the column is part of a foreign key.
Column Name Data Type Nullable? Key? Description
EXPLAIN_REQUESTER VARCHAR(128) No PK, FK Authorization ID of initiator of this Explain request.
EXPLAIN_TIME TIMESTAMP No PK, FK Time of initiation for Explain request.
SOURCE_NAME VARCHAR(128) No PK, FK Name of the package running when the dynamic statement was explained or name of the source file when the static SQL was explained.
SOURCE_SCHEMA VARCHAR(128) No PK, FK Schema, or qualifier, of source of Explain request.
SOURCE_VERSION VARCHAR(64) No PK, FK Version of the source of the Explain request.
EXPLAIN_LEVEL CHAR(1) No PK, FK Level of Explain information for which this row is relevant. Valid values are:
O
Original text (as entered by user)
P
PLAN SELECTION
STMTNO INTEGER No PK, FK Statement number within package to which this Explain information is related. Set to 1 for dynamic Explain SQL statements. For static SQL statements, this value is the same as the value used for the SYSCAT.STATEMENTS catalog view.
SECTNO INTEGER No PK, FK Section number within package that contains this SQL statement. For dynamic Explain SQL statements, this is the section number used to hold the section for this statement at run time. For static SQL statements, this value is the same as the value used for the SYSCAT.STATEMENTS catalog view.
DIAGNOSTIC_ID INTEGER No PK ID of the diagnostic for a particular instance of a statement in the EXPLAIN_STATEMENT table.
CODE INTEGER No No A unique number assigned to each diagnostic message. The number can be used by a message API to retrieve the full text of the diagnostic message.