码迷,mamicode.com
首页 > 数据库 > 详细

oracle游标的使用

时间:2018-01-17 12:35:44      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:div   from   font   weight   cursor   取数   class   color   int   

--游标的使用
步骤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;
  

 

oracle游标的使用

标签:div   from   font   weight   cursor   取数   class   color   int   

原文地址:https://www.cnblogs.com/hkdpp/p/8301940.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!