Home » SQL & PL/SQL » SQL & PL/SQL » Count of updated rows...
Count of updated rows... [message #1387] Thu, 25 April 2002 08:27 Go to next message
lysyi
Messages: 1
Registered: April 2002
Junior Member
How can i get a count of updated rows after update...
Re: Count of updated rows... [message #1388 is a reply to message #1387] Thu, 25 April 2002 08:34 Go to previous message
Senthil
Messages: 68
Registered: December 1999
Member
sql%rowcount will do...

SQL> r
1 begin
2 update t set no = no where no <= 2;
3 dbms_output.put_line('Rows Processed ' || to_char(sql%rowcount));
4* end;
Rows Processed 2

PL/SQL procedure successfully completed.

SQL> r
1 begin
2 update t set no = no where no <= 3;
3 dbms_output.put_line('Rows Processed ' || to_char(sql%rowcount));
4* end;
Rows Processed 3

PL/SQL procedure successfully completed.
Previous Topic: Display information of a table
Next Topic: zero divide error...
Goto Forum:
  


Current Time: Wed Apr 24 09:17:56 CDT 2024