using cursor returned from another stored proc [message #411042] |
Wed, 01 July 2009 12:21  |
Supertd
Messages: 15 Registered: December 2008 Location: Africa
|
Junior Member |
|
|
Hi,
I am trying to use a cursor returned from another stored proc in my stored proc but cant seem to be able to open it.
Example:
function abc() return boolean is
myCur p_ref_cursor;
myInt number;
begin
myInt:=4;
--call another proc that takes an int ant returns a cursor
procX(myInt, myCur);
--now I want to check if myCur contains any rows
open myCur; --this is the line that the error occurs on
if myCur%NOTFOUND --ie, has no rows
return true;
else return false;
end if;
end;
The error I get is :
Error: PLS-00382: expression is of wrong type
Line: xx
Text: open myCur;
Can anyone please assist.
Thanks in advance.
|
|
|
|
|
Re: using cursor returned from another stored proc [message #411151 is a reply to message #411042] |
Thu, 02 July 2009 03:05   |
Supertd
Messages: 15 Registered: December 2008 Location: Africa
|
Junior Member |
|
|
Hi,
procX does open the cursor before returning it. p_ref_cursor is of type REF CURSOR. Is it then ok for me to just say
without using an open statement again? Is there any other way that I can check if any rows are returned in the cursor without having to loop through it?
Thanks.
|
|
|
|
|
|
|