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
2018-09-13, 711👍, 0💬
Popular Posts:
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
Where to find answers to frequently asked questions on Downloading and Installing SQL Server 2005 Ex...
What are DDL (Data Definition Language) statements for tables in SQL Server? DDL (Data Definition La...
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns...
Where to find answers to frequently asked questions on SQL Transaction Management in Oracle? Here is...