首页 > 数据库技术 > 详细

oracle 存储过程遍历

时间:2018-08-08 21:14:25      阅读:220      评论:0      收藏:0      [点我收藏+]

declare
 
begin
   for i in (select * from person t where rownum<10) loop
     dbms_output.put_line(i.psn_code||‘******‘||i.zh_name);
   end loop;
end;

 

 

declare
 type v_cur is ref cursor;
 v_psn v_cur;
 v_psn_code number;
begin
  open v_psn  for select t.psn_code from person t where rownum<10;
   loop
     fetch v_psn into  v_psn_code ;
         exit when v_psn%notfound;
         dbms_output.put_line(v_psn_code);
     end loop; 
   close    v_psn; 
end;

 

oracle 存储过程遍历

原文:https://www.cnblogs.com/hyhfirst12138/p/9445449.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!