Topic: The trigger on removal
Works the trigger on DML, and changed on the new created table.
It is necessary that in tables it was saved no more count = 10000 for example if the amount was exceeded, works one more trigger and deletes
Here only how to delete last 5000 added ?
CREATE OR REPLACE TRIGGER AUDIT_TRIGGER_NAME BEFORE INSERT ON AUDIT_TABLE_LOGS ENABLE DECLARE V_COUNT NUMBER; BEGIN SELECT COUNT (*) INTO V_COUNT FROM AUDIT_TABLE_LOGS; IF V_COUNT> 10000 THEN DELETE FROM AUDIT_TABLE_LOGS WHERE ROWID <= 5000; END IF; END; /
In advance thanks!