Example 4: Functions Declared and Defined in a Package and Package Body
This topic provides an example of a function declared and defined in a package and package body.
Suppose that an Oracle stored procedure is defined as:
|
To add the stored procedure into a Logi JReport catalog, follow the steps below:
- Start Logi JReport Designer and open an existing catalog.
- In the Catalog Manager, right-click the data source to which the stored procedure is to be added, then select New User Defined Data Source. The New User Defined Data Source dialog appears.
- In the Name field, specify a name for the UDS, for example, UDS1.
- In the Class Name field, input the UDS class jet.datasource.oracle.OracleProcedureUDS.
- In the Parameter box, enter one of the following:
DRIVER=oracle.jdbc.driver.OracleDriver&URL="jdbc:oracle:thin:@<hostname>:1521:oracle8"&USER=scott&PSWD=tiger&
OWNER=SCOTT&PROCNAME=deptquery_func&SQL={? = call shdemo_pkg.deptquery_func(?)}&REFCURSORINDEX=1&PARAMVALUE="SALES"DRIVER=oracle.jdbc.driver.OracleDriver&URL="jdbc:oracle:thin:@<hostname>:1521:oracle8"&USER=scott&PSWD=tiger&
OWNER=SCOTT&PROCNAME=deptquery_func&SQL={? = call shdemo_pkg.deptquery_func(?)}&REFCURSORINDEX=1&INPARAMVALUE="SALES",varchar,2OWNER=SCOTT&PROCNAME=deptquery_func&SQL={? = call shdemo_pkg.deptquery_func(?)}&REFCURSORINDEX=1&PARAMVALUE="SALES"
OWNER=SCOTT&PROCNAME=deptquery_func&SQL={? = call shdemo_pkg.deptquery_func(?)}&REFCURSORINDEX=1&INPARAMVALUE="SALES",varchar,2
- Select the OK button. The UDS class will then be added into the catalog.