Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: rowcount
From the PL/SQL manual (Section - Using Cursor Attributes):
%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.
You can use it this way :
DELETE FROM emp WHERE ...
IF SQL%ROWCOUNT > 10 THEN -- more than 10 rows were deleted
...
END IF;
"Christopher" <christopher_at_netdimensions.com> wrote in message
news:t7hl9v22e8024c_at_news.supernews.com...
> After a Insert, update or delete operation, how can I obtain the number of
> affected rows in PL/SQL?
>
>
>
Received on Wed Jan 31 2001 - 22:09:17 CST