Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ref cursor type

user626688Apr 7 2011 — edited Apr 7 2011
Hello All,

I have a small procedure like the following.

CREATE OR REPLACE procedure PROC_DEPT_SALE(SALEC_CUR out sys_refcursor)
as
begin
open sale for select * from dept_sale where dept_no='Z2341324';
end;
/

I just want to execute it from toad like

exec PROC_DEPT_SALE( C1);

In order to do that i need to have a sys_refcursor c1 created in my DB. I know that i can execute it as a plsql block like this

DECLARE
SALE SYS_REFCURSOR;
BEGIN
PROC_DEPT_SALE( SALE );
END;

Could anyone please let me know how can i create a TYPE REF cursor which is permanantly stored in the DB and then execute the proc the way i wanted to using the first statement.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2011
Added on Apr 7 2011
12 comments
658 views