Sql%rowcount returns the number of rows affected

Source: Internet
Author: User
Tags rowcount

In Oracle. Returns the number of affected rows: If Sql%rowcount


Example:

      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        inserts 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--The above update affects the number of rows >1 inserted into the my_time_test1 insert into    my_time_test1 values (sysdate, ' 7 ');    End If; END;


Sql%rowcount returns the number of rows affected

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.