Sql%rowcount is used to record the number of modified bars, as if you were prompted to delete xx rows after executing the delete from Sqlplus, this parameter must be placed between a modification statement and a commit, otherwise you will not get the correct number of modified rows.
For example:
Declare n number;begin insert into test_a Select level LV from dual connect by level<500; N:=sql%rowcount; Commit Dbms_output.put_line (n); end;/
Declare n number;begin insert into test_a Select level LV from dual connect by level<500; Commit N:=sql%rowcount; Dbms_output.put_line (n); end;/
If several SELECT statements are executed consecutively
Then call Sql%rowcount, and the result is the number of the last select.
To count all, you can use three variables to receive Sql%rowcount, and then add, but it seems that the direct select of the wording cannot use Sql%rowcount.
Sql%rowcount in Oracle