2012-12-01 77 views

回答

1

您將需要使用Ref Cursors以允許從存儲過程和函數返回記錄集。

CREATE PROCEDURE PC_APP.Test_proc1 (prc out sys_refcursor) 
IS 
BEGIN 

OPEN prc SELECT * from mytable; 

END; 

在命令行

SQL> var rc refcursor 
SQL> execute prc(:rc) 
SQL> print rc 
1
CREATE PROCEDURE PC_APP.Test_proc1 (prc out sys_refcursor) 
IS 
BEGIN 

OPEN prc for SELECT * from mytable; 

END;