Oracle 游标 以及CLOB的简单操作

Sample:

 

declare
  cursor Mycursor is  select * from auto_event where event_id between 54652 and 54681;
 
  begin
    For  MyOncursor in Mycursor
        Loop     
          if MyOncursor.status=2  then       
            update cm_auto_event set status=11 where event_id =MyOncursor.event_id;
          end if;
        end loop;
  end;

 

其中 注意if 语句的写法

当让游标的遍历还有 好几种方法:不知道行不行得通

declare
  cursor Mycursor is  select event_id,status from cm_auto_event where event_id between 54652 and 54681;
  eventid number;
  status number;
 
  begin
  open Mycursor;
  fetch Mycursor into eventid,status;
    while Mycursor%found 
      Loop
   
        if status=2
          then       
          update cm_auto_event set status=11 where event_id =eventid;
        end if;
      end loop;
    close Mycursor;
    end;

 

**************华丽的分割线*********************************************

 

下面是关于 CLOB的操作:

Declare
content varchar2(20000) := '字符型打字段最大的容量好像为4G';
Begin
          insert into table_name values (265,'RBC Dexia merge',content,2,user,sysdate) ;
End;

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值