Choose Edit Subquery from the Values drop-down list on the Edit Condition

Advanced Discoverer Desktop Features 8-17

8.7 Using SQL

If you are familiar with SQL, you can analyze the SQL statements that Discoverer Desktop executes against the database. You can also open workbooks with your own SQL programming statements.

8.7.1 Looking at the SQL Statements for Worksheets

To see a worksheet’s SQL statements: 1. Choose View | SQL Inspector. The SQL Inspector dialog box appears. It shows the SQL statements used to create your current worksheet. Figure 8–16 SQL Inspector Dialog

2. Click Copy to copy the statements and paste them to another SQL program.

The SQL statements Discoverer Desktop uses to open a workbook or worksheet involve complex programming. Therefore, you cannot simply copy a worksheet’s SQL and use it to open another workbook or worksheet. You must write your own programs.

3. Click Export to export the statements to another file for use later with another SQL

program.

4. Click OK to close the SQL Inspector dialog box.

8.7.2 Importing SQL

If you have written an SQL program to open a workbook, importing the program executes the SQL statement and opens the Discoverer Desktop workbook. To import SQL and open a workbook: Note: If you are importing an SQL script tha contains join definitions, the joins must have been created first by your Discoverer manager using Discoverer Administrator. 8-18 Oracle Fusion Middleware Users Guide for Oracle Business Intelligence Discoverer Desktop 1. Choose File | Import SQL. The Open dialog box appears. Figure 8–17 Open SQL File Dialog

2. Locate and select the file that contains the SQL statement, then click Open.

A new workbook is then created from the query defined by the SQL statement.

8.7.3 Using the Discoverer Execution Plan

The Plan tab displays the Oracle Server Execution Plan chosen by the Oracle Server for a query request. The Execution Plan defines the sequence of operations that the Oracle Server performs to execute the SQL statement. This facility is useful when using Summary tables and Materialized Views.

8.7.3.1 About Summaries

Summary tables and Materialized Views store precomputed aggregated data, which is used where possible instead of data retrieved directly from the database. Because Summary tables and Materialized Views are much quicker to access, this enhances the performance of Discoverer Desktop. Summary Management is handled automatically by Discoverer, and is transparent to most Discoverer Desktop users. However, you may wish to use the SQL Inspector feature to look at SQL statements being generated. For example, when using Summaries, you may wish to check that a query is using a Summary or Materialized View created by your Discoverer manager.

8.7.3.2 Types of Summary

Summaries are created by your Discoverer manager to help do your work more quickly and efficiently. Two types of Summary are used: ■ A Summary table is a table created by Discoverer. ■ A Materialized View is the Oracle database server’s own summary mechanism.

8.7.4 Looking at an SQL Execution Plan

To see a worksheet’s Execution Plan: Note: For more information on Summaries and Materialized Views, see Oracle Database Data Warehousing Guide.