Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How do I view SYS_REFCURSOR output parameters in TOAD?
I don't think you can achieve what you want in TOAD but you can in
SQLPLUS.
Please see below and tell me if it works...
paulb_at_OCP> CREATE OR REPLACE PACKAGE MY_PKG AS
2 TYPE CURSOR_A IS REF CURSOR ; 3 TYPE CURSOR_B IS REF CURSOR ; 4 PROCEDURE SAMPLE_FUNC (CURSOR_A OUT SYS_REFCURSOR,CURSOR_B OUT SYS_REFCURSOR, lastName
Package created.
paulb_at_OCP>
paulb_at_OCP> CREATE OR REPLACE PACKAGE BODY MY_PKG AS
2 PROCEDURE SAMPLE_FUNC (CURSOR_A OUT SYS_REFCURSOR,
CURSOR_B OUT SYS_REFCURSOR, lastName
VARCHAR)
3 IS 4 BEGIN
7 OPEN CURSOR_A FOR 8 SELECT * from EMP WHERE ENAME = lastName;9
11 OPEN CURSOR_B FOR 12 SELECT * from DEPT;
Package body created.
paulb_at_OCP> paulb_at_OCP> paulb_at_OCP> paulb_at_OCP> variable rc1 refcursor; paulb_at_OCP> variable rc2 refcursor; paulb_at_OCP> paulb_at_OCP> execute MY_PKG.SAMPLE_FUNC(:rc1,:rc2,'ALLEN');
PL/SQL procedure successfully completed.
paulb_at_OCP>
paulb_at_OCP> print rc1
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
paulb_at_OCP>
paulb_at_OCP> print rc2
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON
paulb_at_OCP>
paulb_at_OCP>
Received on Fri Mar 10 2006 - 18:31:38 CST