Oracle PL/SQL - How To Retrieve the Count of Updated Rows
Interview Question Database For Software Developers
|
|
| How To Retrieve the Count of Updated Rows | | How To Retrieve the Count of Updated Rows? - Oracle DBA FAQ - Working with Database Objects in PL/SQL | | By: FYIcenter.com | After running an UPDATE statement, the database server returns
a count of updated rows. You can retrieve this count from a special predefined
variable called SQL%ROWCOUT, as shown in the following tutorial:
CREATE TABLE emp_temp AS SELECT * FROM employees;
BEGIN
UPDATE emp_temp SET salary = salary * 1.05
WHERE salary < 5000;
DBMS_OUTPUT.PUT_LINE('# of rows updated: ' ||
SQL%ROWCOUNT);
END;
/
# of rows updated: 49
| | ID: 760 | Rank: 1097 | Votes: 0 | Views: 55 | Submitted: 20070427 |
1084 :-) | | What Is the Implicit Cursor | | What Is the Implicit Cursor? - Oracle DBA FAQ - Working with Database Objects in PL/SQL... | | Submitted: 20070427 |
|
Copyright © 2009 FYIcenter.com
All rights in the contents of this Website are reserved by the individual author.
No part of the contents may be reproduced in any form without author's permission.
|
|
|