Analyzing an SQL statement embedded in a source code file


To analyze a statement from a source code file

  1. Open or create a workspace.
  2. In the File Locator perspective, click Add Filter NW_plus_circle_o.png.
  3. 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.
  4. 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.
  5. In the hierarchical tree, navigate to the data set that contains the files that you require.
  6. Select the file containing the required statement and click Edit NW_pencil_adapt.png.
  7. In the Scratchpad perspective, select the SQL statement you want to analyze and click Explain selected text NW_generate_explain.png.
    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

  8. 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.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*