Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> How do I view SYS_REFCURSOR output parameters in TOAD?
I'm new to Oracle and TOAD although I have years of experience with SQL
Server. I'm comfortable creating procedures and such in TOAD and I can
get back the results of a function, but I can't figure out how to view
the results of output parameters in TOAD, specifically SYS_REFCURSOR
output parameters. Here is a simple example of what I am trying to do:
CREATE OR REPLACE PACKAGE MY_PKG AS
TYPE CURSOR_A IS REF CURSOR ; TYPE CURSOR_B IS REF CURSOR ; PROCEDURE SAMPLE_FUNC (CURSOR_A OUT SYS_REFCURSOR, CURSOR_B OUTSYS_REFCURSOR, lastName VARCHAR);
IS BEGIN OPEN CURSOR_A FOR SELECT * from EMPLOYEES WHERE EMP_LAST_NAME = lastName; OPEN CURSOR_B FOR SELECT * from EMPLOYEE_GROUPS; END SAMPLE_FUNC;
DECLARE
test1 SYS_REFCURSOR;
test2 SYS_REFCURSOR;
BEGIN exec MY_PKG.SAMPLE_FUNC(test1, test2, 'Smith');
print test1;
print test2;
END; Obviously this syntax does not work. What do I need to do to make it work? Received on Fri Mar 10 2006 - 09:17:15 CST