How to insert updated rowcount value into table
732202May 18 2011 — edited May 18 2011Hi,
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