Home » SQL & PL/SQL » SQL & PL/SQL » Cursor
Cursor [message #2590] Tue, 30 July 2002 00:19 Go to next message
Suba
Messages: 2
Registered: July 2002
Junior Member
Hi
I have 2 procs in a package.
Proc 1 has a In parameter(string) and a Cursor Out parameter.
Now i need to call the proc1 in proc2.
I used this in proc2:

declare
Type cur1 is ref cursor;
curdata cur1;
begin
Proc1(str, curdata);
for rows in curdata
loop
--stmts
end loop;
end;

I am getting curdata undefined. I tried the cur1 declaration package level also.i am getting the same error.
ne idea how to solve this problem?
Thanks
Subha
Re: Cursor [message #2600 is a reply to message #2590] Tue, 30 July 2002 09:01 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
You won't be able to use a CURSOR FOR loop in this context. Proc1 has already opened the cursor so Proc2 needs to use a standard loop/fetch and close.

Proc1(str, curdata);
loop
  fetch curdata into ...;
  exit when curdata%notfound;
  -- do something
end loop;
close curdata;
Previous Topic: Re: switching between databases on the same computer
Next Topic: Using Bulk Binds in Stored Procedures
Goto Forum:
  


Current Time: Wed Apr 24 05:22:58 CDT 2024