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: How many rows were updated ?

Re: How many rows were updated ?

From: Christopher Beck <clbeck_at_us.oracle.com>
Date: Tue, 27 Jul 1999 21:40:16 GMT
Message-ID: <37a226d9.120856602@inet16.us.oracle.com>


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.



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Jul 27 1999 - 16:40:16 CDT

Original text of this message

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