To create a REF CURSOR
query:
Create a package that defines a REF CURSOR
type
in one of the following ways:
If the package created in Step 1 is an external PL/SQL library, you must attach it to the report before referencing it.
In the Data Model view, single-click
in the tool palette.
Click in the main area (canvas region) of the window.
In the PL/SQL Editor, type
the PL/SQL for a function that opens a cursor and returns a cursor variable
of the REF CURSOR
type you defined in the package. For example:
empCur rcPackage.empCurType;
BEGIN
OPEN empCur FOR SELECT * FROM emp;
RETURN empCur;
END;
/* Note, rcPackage is a local program unit defined as: */
PACKAGE rcPackage IS
TYPE empCurType IS REF CURSOR RETURN emp%ROWTYPE;
END;
Note: Oracle Reports supports both static and dynamic
REF CURSOR
s. For more information, see About
REF CURSOR
queries.
Refine the query as desired:
Click the REF CURSOR
query object, then choose
ToolsProperty Inspector
to modify properties.
Click the query object, then choose ToolsData Wizard
to specify which fields to display, group fields, and any totals.
Repeat Steps 1 through 6 for each REF CURSOR
query you want to create.
Next step
Creating a default layout for a report
Creating a query: SQL Query tool
Creating a query: XML Query tool
Creating a query: JDBC Query tool
Creating a query: Text Query tool
Creating a query: Express Server Query tool
Creating a query: OLAP Query tool
The chapter titled "Building a Paper Report with REF CURSORs " in
the Oracle Reports Building Reports manual, available on the Oracle
Technology Network Oracle Reports Documentation page (http://www.oracle.com/technology/documentation/reports.html
).
Copyright © 1984, 2005, Oracle. All rights reserved.