41 Building a Paper Report with REF CURSORs

In this chapter, you will learn about reports that include the PL/SQL datatype REF CURSOR. By following the steps in this chapter, you can generate the report output shown in Figure 41-1.

Figure 41-1 REF CURSOR report output

Description of Figure 41-1 follows
Description of "Figure 41-1 REF CURSOR report output"


Example Scenario

In this example, you will learn how to use REF CURSORs in Reports Builder to create a detailed paper report showing information about employees and the job position they hold in each department. You will use the Data Model view to create a multiquery data model, and then use the Report Wizard to create the report layout. You will make fairly extensive manual refinements in the Data Model view.

As you build this example report, you will:

To see a sample report with REF CURSORs, open the examples folder named refcursor, then open ref_emp68.rdf. For details on how to open it, see "Accessing the Example Reports" in the Preface. The example files used in this chapter are listed and described in Table 41-1.

Table 41-1 Example report files

File Description


The different stages of the RDF. You can refer to these files as you complete each section of this chapter. The file ref_emp68.rdf is the final report.


The PL/SQL code you will write in this chapter. You can use this file as a reference point to make sure your code is accurate, or you can simply copy and paste from this file into Reports Builder.