我有2个程序,如
my_es.example.com
我想做的是
PROCEDURE proc1(param1 in varchar2, param2 out sys_refcursor)
:
:
:
END proc1;
PROCEDURE proc2(param3 in sys_refcursor)
:
:
:
END proc2;
但我收到错误代码-29471 有人有想法吗? 感谢
答案 0 :(得分:0)
您似乎错误地使用了它,并且没有显示实际导致错误的代码部分。这是我如何做的一个例子,它运行得很好。
SET SERVEROUTPUT ON
DECLARE
x NUMBER;
y VARCHAR2(100);
p1 VARCHAR2(5) := 'YES';
p2 SYS_REFCURSOR;
PROCEDURE proc1(param1 IN VARCHAR2,
param2 OUT SYS_REFCURSOR)
IS
BEGIN
OPEN param2 FOR
SELECT 1 id,
'abc' n
FROM dual
WHERE param1 = 'YES';
END proc1;
PROCEDURE proc2(param3 IN SYS_REFCURSOR)
IS
BEGIN
FETCH param3 INTO x, y;
dbms_output.put_line('x = '
||x
||',y = '
||y);
END proc2;
BEGIN
proc1(p1, p2);
proc2(p2);
END;
/
PL/SQL procedure successfully completed.
x = 1,y = abc