Home » SQL & PL/SQL » SQL & PL/SQL » Updated rows count
Updated rows count [message #353724] Tue, 14 October 2008 20:49 Go to next message
payat
Messages: 2
Registered: October 2008
Junior Member
Is there a way in pl/sql to be able to know the number of affected rows during an update transaction?
Re: Updated rows count [message #353728 is a reply to message #353724] Tue, 14 October 2008 22:11 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member


%ROWCOUNT

Thumbs Up
Rajuvan.
Re: Updated rows count [message #353729 is a reply to message #353728] Tue, 14 October 2008 22:20 Go to previous messageGo to next message
payat
Messages: 2
Registered: October 2008
Junior Member
i think the %ROWCOUNT function works for select only.

what i want to know is after executing an update statement how to get the number of rows affected

[Updated on: Tue, 14 October 2008 22:22]

Report message to a moderator

Re: Updated rows count [message #353731 is a reply to message #353728] Tue, 14 October 2008 22:27 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

rajavu1 wrote on Wed, 15 October 2008 08:41

%ROWCOUNT

Thumbs Up
Rajuvan.


Re: Updated rows count [message #353753 is a reply to message #353729] Wed, 15 October 2008 00:39 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
payat wrote on Wed, 15 October 2008 05:20
i think the %ROWCOUNT function works for select only.

Why do you think so? Did you test it and find it does not work for updates?
Re: Updated rows count [message #353754 is a reply to message #353729] Wed, 15 October 2008 00:41 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
A valid link: %ROWCOUNT

Better refer to Oracle documentation. Wink

Regards
Michel

[Updated on: Wed, 15 October 2008 08:35]

Report message to a moderator

Re: Updated rows count [message #353756 is a reply to message #353724] Wed, 15 October 2008 00:44 Go to previous message
kc1982
Messages: 13
Registered: October 2006
Junior Member
for your reference

http://www.java2s.com/Code/Oracle/PL-SQL/ImplicitcursorsSQLROWCOUNTreturnsnumberofrowsaffectedbySQLstatement.htm
Previous Topic: ORA-01722 Error
Next Topic: procedure execution
Goto Forum:
  


Current Time: Sat Dec 03 03:51:00 CST 2016

Total time taken to generate the page: 0.14481 seconds