码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-12-13 19:37:42      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:out   好的   存储过程   遇到   not   工作   定义   code   from   

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

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

标签:out   好的   存储过程   遇到   not   工作   定义   code   from   

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

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