declare
type c_dept is ref cursor ;
c1 c_dept;
begin
open c1 for select * from dept;
--这里报错ORA-06550
for t1 in c1 loop
dbms_outPut.put_line(t1.deptno);
end loop;
end;
------解决方案--------------------
for循环不用open游标
declare
type c_dept is ref cursor ;
c1 c_dept;
begin
open c1 for select * from dept;
--这里报错ORA-06550
for t1 in c1 loop
dbms_outPut.put_line(t1.deptno);
end loop;
end;