oracle游标的使用

--游标的使用
步骤1、声明游标
2、打开游标
3、获取数据
4、关闭游标
declare
cursor cur is
select * from emp;
t_sal cur%rowtype;
begin
open cur;
loop
fetch cur into t_sal;
exit when cur%notfound;
dbms_output.put_line(t_sal.ename || ':' || t_sal.sal); 
end loop;
close cur;
end;
  
原文地址:https://www.cnblogs.com/hkdpp/p/8301940.html