Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to insert updated rowcount value into table

732202May 18 2011 — edited May 18 2011
Hi,

I got updated rowcount using SQL%ROWCOUNT, i need to insert those count number into another table. How i can do that. Here is the sample script.

DECLARE
count number := 0;
BEGIN
UPDATE table1
SET ID = 'abc',
SYS_UPDATE_DATE = SYSTIMESTAMP
WHERE ID = 'xyz';
count := SQL%ROWCOUNT;

-- Insert update count into table
INSERT INTO UPDATE_HISTORY VALUES('xyz', count);

-- Update same value in another table
UPDATE UPDATE_HISTORY SET update_count = count
WHERE ID = 'xyz';
END;


When i print that value using DBMS_OUTPUT.putline is working fine, but in database 'UPDATE_COUNT' - null/ blank.

Is some where i am missing something....? pls help on this...


Thanks,
-Soma
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 15 2011
Added on May 18 2011
5 comments
1,753 views