首页 > 其他 > 详细

cursor 在某一操作之前打开 fetch cursorname into var1

时间:2018-12-13 18:44:38      阅读:159      评论:0      收藏:0      [点我收藏+]

工作中遇到这样一个问题,在一个存储过程中,我想让一个游标在某一操作之前打开,说白了操作会影响我游标中已定义好的数据,这里我们用到游标的第二种用法,代码如下

cursor c_relation is

      select f_id from ly_zg_bhrelationcheck d where d.file_id = varFILE_ID;
--申明
     

     open c_relation;
--打开

     loop

      fetch c_relation into varF_id;

      update ly_zg_bhrelationcheck d

         set d.file_id = varLogoutDocID

       where d.f_id = varF_id;

      exit when c_relation%notfound;

    end loop;
--循环操作数据

 

cursor 在某一操作之前打开 fetch cursorname into var1

原文:https://www.cnblogs.com/wangjp-1233/p/10115480.html

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