16:30:48 SQL> create or replace procedure p_a as
16:31:09 2 begin
16:31:15 3 insert into t select * from tt where rownum<6;
16:31:32 4 dbms_output.put_line(sql%rowcount);
16:31:47 5 end p_a;
16:31:54 6 /
%ROWCOUNT yields the number of rows affected by an INSERT, UPDATE, or DELETE
statement, or returned by a SELECT INTO statement. %ROWCOUNT yields 0 if an
INSERT, UPDATE, or DELETE statement affected no rows, or a SELECT INTO
statement returned no rows. In the following example, you use %ROWCOUNT to take
action if more than ten rows have been deleted:
DELETE FROM emp WHERE ...
IF SQL%ROWCOUNT > 10 THEN -- more than 10 rows were deleted
...
END IF;