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;


原文地址:https://www.cnblogs.com/liguangsunls/p/7093831.html