EnterpriseDB Stored Procedure UDS
Due to the unique nature of EnterpriseDB stored procedures, you cannot add them directly into a Logi Report catalog. As a substitute, Logi Report has developed the user data source API which can use stored procedures in EnterpriseDB. The usage of EnterpriseDB stored procedures is the same as that of Oracle stored procedures, except that the class name for EnterpriseDB stored procedures is EnterpriseDbProcedureUDS, in the package jet.datasource.enterprisedb. This class is already included in Logi Report Designer and Logi Report Server so you do not need to write any code or modify the classpath.
The following takes an example to show how to add an EnterpriseDB stored procedure to a catalog.
Suppose that an EnterpriseDB stored procedure is defined as follows:
create or replace package shdemo
as
type curtype
is
ref
cursor;
end shdemo;
create or replace procedure empquery (param1 in varchar2,
cur out shdemo.curtype) as lcur shdemo.curtype;
begin
open lcur for
select
*
from
emp
where
job = param1;
cur:=lcur;
end empquery;
To add the stored procedure into a Logi Report catalog, follow the steps below:
- Start Logi Report Designer and open the catalog to which you want to add the stored procedure.
- In the Catalog Manager, right-click the data source 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 text box, specify a name for the UDS, for example, UDS1.
- In the Class Name text box, type the UDS class jet.datasource.enterprisedb.EnterpriseDbProcedureUDS.
- In the Parameter box, type any of the following:
DRIVER=com.edb.Driver&URL="jdbc:edb://222.222.222.45:5444/edb"&USER=enterprisedb&PSWD=db1234&OWNER=enterprisedb&PROCNAME=empquery&SQL={call empquery(?,?)}&REFCURSORINDEX=2&PARAMVALUE=@job1
DRIVER=com.edb.Driver&URL="jdbc:edb://222.222.222.45:5444/edb"&USER=enterprisedb&PSWD=db1234&OWNER=enterprisedb&PROCNAME=empquery&SQL={call empquery(?,?)}&REFCURSORINDEX=2&INPARAMVALUE=@job1,varchar,1
OWNER=enterprisedb&PROCNAME=empquery&SQL={call empquery(?,?)}&REFCURSORINDEX=2&PARAMVALUE=@job1
- Select OK, and the UDS class will be added into the catalog.