sql%rowcount 返回影響行數,sql%rowcount行數

來源:互聯網
上載者:User

sql%rowcount 返回影響行數,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;


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.