Analyzing an SQL statement embedded in a source code file
To analyze a statement from a source code file
- Open or create a workspace.
- In the File Locator perspective, click Add Filter
.
- In the Add Data Set View dialog box, in the Filter field, enter a filter pattern for the data sets.
The high-level qualifier cannot contain a wildcard. The wildcard * is supported for the last qualifier in the data set name or member name. - Click OK to search for all data sets and data set members (files) that satisfy your filter.The matching data sets and data set members are displayed in a hierarchical tree on the navigator pane. Details of the data sets and data set members are displayed in the results pane.
- In the hierarchical tree, navigate to the data set that contains the files that you require.
- Select the file containing the required statement and click Edit
.
In the Scratchpad perspective, select the SQL statement you want to analyze and click Explain selected text
.
The Performance perspective displays the SQL statement and its parameters with the following defaults:Field
Default
Name
New Statement
Db2 Connection
The Db2 Connection used to run the statement in the Scratchpad perspective
If no Db2 connection was selected, the default value is blank.
Explain Type
Dynamic
Table Qualifier
The Current SQLID in the Scratchpad perspective
If the Current SQLID is blank, the default value is blank.
Degree
The Degree field in the Performance perspective options dialog box
Statement
The SQL statement you selected in the Scratchpad perspective
- In the Performance perspective, you can now perform SQL tuning tasks. For more information, see the following topics:
Where to go from here
You can return to the results pane in the File Locator perspective to select other files.