本帖最后由 huangcunguilai1 于 2011-08-22 11:35:09 编辑

解决方案 »

  1.   

    -- 更新一个字段的数据,用一个SQL语句就OK啦,为什么偏偏要用游标呢?用SQL语句批量更新是最高效的方法!
      

  2.   

    不太理解楼主为什么用游标更新,用游标的效率不会太高的。
    建议直接用update更新不是更好的方法
      

  3.   

    update就是可以更新多条的啊。lz应该把需求具体说明一下
      

  4.   

    LZ是不是专门在练习怎样使用游标啊,给你一个小例子,不知是不是你要的
     declare
              cursor c is select * from emp2 for update;
            begin
              for v_temp in c loop
                if(v_temp.sal<2000) then
                  update emp2 set sal=sal*2 where current of c;
                elsif(v_temp.sal=5000) then
                  delete from emp2 where current of c;
                 end if;
                 end loop;
                commit;
              end;
              /