Oracle® Fusion Middleware Oracle Reports User's Guide to Building Reports 11g Release 1 (11.1.1) Part Number B32122-02 |
|
|
PDF · Mobi · ePub |
When you create a report with multiple queries, it is typically easier to create all of the queries with the Data Wizard first and then create the layouts with the Reports Wizard.
To create the queries:
In the Data Model view, choose Insert > Query to display the Data Wizard.
If the Welcome page displays, click Next.
On the Query page, type Q_Dept
for the Query name and click Next.
On the Data Source page, click SQL Query, then click Next.
On the Data page, enter the following SELECT
statement in the Data Source definition field:
SELECT DEPARTMENT_ID, DEPARTMENT_NAME, LOCATION_ID FROM DEPARTMENTS
Note:
You can enter this query in any of the following ways:Copy and paste the code from the provided text file called masterb_code.txt
into the Data Source definition field.
Click Query Builder to build the query without entering any code manually.
Type the code in the Data Source definition field.
Click Next.
Note:
If you are not already connected to a database, you will be prompted to connect to the database when you click Query Builder or Next. Ensure that you connect to a database that has the appropriate schema for this example. Section 8.1, "Prerequisites for This Example" describes the sample schema requirements for this example.On the Groups page, click Next.
Click Finish to display the data model for your report in the Data Model view.
Repeat the steps above for a second query, but this time name your query Q_Emp
and use the following SELECT
statement:
SELECT LAST_NAME, FIRST_NAME, JOB_ID, SALARY FROM EMPLOYEES ORDER BY LAST_NAME, FIRST_NAME
Figure 8-3 Data model with two unrelated queries