JasperReports存储了oracle函数java iReport

时间:2012-03-02 09:55:20

标签: oracle cursor jasper-reports ireport stored-functions

我想将存储的函数用于JasperReports。

我按照这篇文章介绍了存储过程http://rajendratambat.blogspot.com/2011/10/calling-oracle-stored-procedure-in.html

但是如何对存储函数进行类似的操作。例如:

CREATE OR REPLACE PACKAGE BODY PKG_TEST_REPORTER
AS

FUNCTION EmpDept(
EMP_ID IN SCOTT.EMP.EMPNO%TYPE)
RETURN SYS_REFCURSOR
IS
CUR SYS_REFCURSOR;
BEGIN

OPEN CUR FOR 
SELECT 
EMP.EMPNO AS "EMPLOYEE_ID", 
EMP.ENAME AS "NAME", 
DEPT.DNAME AS "DEPARTMENT" 
FROM 
SCOTT.EMP EMP, SCOTT.DEPT DEPT 
WHERE EMP.DEPTNO = DEPT.DEPTNO 
AND EMP.EMPNO = EMP_ID;

RETURN CUR;
END EmpDept;

END PKG_TEST_REPORTER;

我尝试在iReport Designer中使用它:

{ $P{ORACLE_REF_CURSOR} = call pkg_test_reporter.empdept(7782)}

但它不起作用。有什么想法吗?

0 个答案:

没有答案