beautypg.com

Explaining sql code – Candle-lite DB2 User Manual

Page 61

background image

Customizing OMEGAMON II

61

Using the Callable Interface

EXPLAINing SQL Code

Use the following procedure to EXPLAIN SQL.

Type of Save

Type of save to be executed when saving SQL text to the member
specified within the SQL statement PDS. Values are REPLACE and
APPEND.

REPLACE writes over an existing member or creates the member if it
does not currently exist. System default.

APPEND concatenates the new SQL text to the existing number.

Default Qualifier

Qualifier to use to qualify unqualified tables, views, and aliases in SQL
statements.

Qualifier Option

Type of qualifier. Values are USE and PROMPT.

USE indicates the current Default Qualifier for unqualified SQL text.

PROMPT indicates you want to be prompted for a Qualifier
whenever an SQL statement is used.

Gather Statistics

Type YES to have !DB/EXPLAIN gather statistics.

Type NO to bypass.

Initial Report

Type the name of the initial !DB/EXPLAIN report to be displayed:
ESTMT, EPATH, EPTBL, EOBJ, or ERECM.

ESTMT

is the actual SQL statement text being explained. If there is

an SQL error, SQL error text also appears. Use the pushbuttons to
select from the other !DB/EXPLAIN report sections that follow.

EPATH

is a narrative describing the access path for the SQL

statement.

EPTBL

reports the plan table entries for the SQL statement in

tabular form.

EOBJ

reports the DB2 catalog statistics for objects referenced by the

SQL statement. This section is available if you specified Yes for
Gather Statistics in the D2/EXPLAIN Options panel under the
Option pull-down (fastpath 08).

ERECM

provides suggestions for optimizing the SQL statement.

For more information about !DB/EXPLAIN parameters, see the
!DB/EXPLAIN Reference Manual

.

Step

Action

1

Log onto CUA.

Field

Description