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, 2876🔥, 0💬
Popular Posts:
What To Do If the StartDB.bat Failed to Start the XE Instance in Oracle? If StartDB.bat failed to st...
How to download Microsoft SQL Server 2005 Express Edition in SQL Server? Microsoft SQL Server 2005 E...
How To Change the Password for Your Own User Account in MySQL? If you want to change the password of...
How To Round a Numeric Value To a Specific Precision in SQL Server Transact-SQL? Sometimes you need ...
How To Create a Stored Program Unit in Oracle? If you want to create a stored program unit, you can ...