Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> PLS-00225: subprogram or cursor reference is out of scope: REF CURSOR required?
Hello all,
I'm VERY rusty on PL/SQL...and I'm running into this error. I'm basically trying to do something like this:
DECLARE cursor c_main_cursor is select person_id, class_id from table1;
cursor c_secondary_cursor is select field1, field2
from table2
where field1 = c_main_cursor.person_id;
BEGIN ...
I thought you could use one cursor's fields in another cursor, as long as it was declared after the primary one....
I remember LONG ago...I ran into something similar, but, more drastic (generating SQL for DDL on the fly I think) where I had to use REF CURSORS...which were a bit of a PITA since you couldn't use nice neat cursor for loops...had to fetch and all pretty manually.
Anyway, this is a very simplified example of what I'm needed to do....can someone tell me if I have to use a REF CURSOR in this instance, or maybe I just have typoes somewhere or something else I might have overlooked.
This is for an anonymouse PL/SQL block....trying to generate some reports here that have some very strange and complex rules...and I'm quite limited on tools...just the database and sqlplus...
TIA, chilecayenne Received on Wed Jun 14 2006 - 11:30:11 CDT