How to obtain Rows affected in PL/SQL??? [message #38339] |
Fri, 12 April 2002 00:45 |
O. Vamsi Krishna
Messages: 3 Registered: January 2002
|
Junior Member |
|
|
Hi,
Is there any way to obtain the rows affected by a SQL statement(Insert, Update, Delete, Select) in PL/SQL?
There is a structure SQLCA available for PRO*C. Is there anything similar to this in PL/SQL?
Thanks and Regards,
Vamsi
|
|
|
|
Re: How to obtain Rows affected in PL/SQL??? [message #38346 is a reply to message #38339] |
Fri, 12 April 2002 09:16 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
SQL%ROWCOUNT will provide the number of rows involved in the last DML (insert/update/delete) statement. This is not applicable to a SELECT statement though.
sql>begin
2 update user_master
3 set dept_id = 'ABC'
4 where dept_id = 'CIS';
5
6 dbms_output.put_line( 'Rows affected: ' || sql%rowcount );
7 end;
8 /
Rows affected: 86
PL/SQL procedure successfully completed.
|
|
|
|