Number of rows affected by an UPDATE in PL/SQL
The following query can be used to know how many rows are updated. SQL%rowcount is used to find the number rows updated.
DECLARE
i NUMBER;
BEGIN
UPDATE emp
SET ename = 'SCOTT'
WHERE empno =5577;
i := SQL%rowcount;
--note that assignment has to precede COMMIT
COMMIT;
dbms_output.Put_line(i);
END;
No comments:
Post a Comment