Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How many rows were updated ?
On Tue, 27 Jul 1999 20:52:47 GMT, "Vincent GRENET" <vincent.grenet_at_free.fr>
wrote:
>Hi all.
>
>In an stored procedure, how can I know how many rows were updated by an
>update statement ? I've seen in the PRO*C precompiler documentation that I
>can find that information in the sqlca area. But I did not see anything like
>that in the SQL or PL/SQL documentation.
>
>Or can I know if any row was updated ? Same question for a delete.
use sql%rowcount
eg.
SQL> select count(*) from foo;
COUNT(*)
6
SQL> l
1 begin
2 update foo set a = a;
3 dbms_output.put_line( sql%rowcount );
4* end;
SQL> /
6
PL/SQL procedure successfully completed.
>
>Vincent
>
>
>
>
--
Christopher Beck
Oracle Corporation
clbeck_at_us.oracle.com
Reston, VA.