Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Curious problem iterating through a ref cursor (recordset)
All,
I have the following autonomous block. What I want to do is to iterate through each record in the result-set and simply output the job_id. I have simplified the example greatly for your viewing:
DECLARE
TYPE recordset IS REF CURSOR;
lresult recordset;
BEGIN
open lresult for select * from jobs;
close lresult;
for lrec in lresult
loop
dbms_output.put_line(lrec.job_id);
end loop;
END;
I get the error: PLS-000221: 'LRESULT' is not a procedure or is undefined
ORA-06550.
Any ideas how I can get around this?
PT
P.S. Does anyone know of any good PL/SQL newsgroups/news servers? Received on Tue Nov 11 2003 - 05:38:39 CST