Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: rowcount

Re: rowcount

From: Ranga Chakravarthi <ranga_at_nospam.cfl.rr.com>
Date: Thu, 01 Feb 2001 04:09:17 GMT
Message-ID: <Nj5e6.71440$8V6.8933650@typhoon.tampabay.rr.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US