Collections:
Retrieve the Count of Updated Rows in Oracle
How To Retrieve the Count of Updated Rows in Oracle?
✍: 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
⇐ Invoke Built-in Functions in PL/SQL in Oracle
2018-09-13, 3853🔥, 0💬
Popular Posts:
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...
How Fixed Length Strings Are Truncated and Padded in SQL Server Transact-SQL? When the length of the...
Where to find reference information and tutorials on MySQL database functions? I want to know how to...
How to convert a JSON (JavaScript Object Notation) quoted string into a regular character string usi...
What Are the Basic Features of a Trigger in SQL Server? Since a SQL Server trigger is a really an ev...