设为首页 加入收藏

TOP

sql%rowcount返回影响行数
2014-11-23 19:06:17 来源: 作者: 【 】 浏览:25
Tags:sql%rowcount 返回 影响

oracle中,返回影响行数是:If sql%rowcount

举例:

      update ut_calenderStatus t
      set t.calenderstatus=pi_flg,
          t.m=pi_M,
          t.n=pi_N,
          t.prolong=pi_prolong
      where t.fundcode=pi_fundcode;
      if sql%rowcount=0 then
        insert into ut_calenderStatus
        values (pi_fundcode,pi_flg,pi_M,pi_N,pi_prolong);
      end if;
BEGIN
    update MY_TIME_TEST1 set discript = '6' where discript = '1' ;
    If sql%rowcount>1  then 	--上面update影响行数>1就插入到my_time_test1
    insert into MY_TIME_TEST1 values(sysdate,'7');
    end if;
END;
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇SQL update select语句 下一篇SQL中EXISTS的用法

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: