create or replace trigger T_TEST
after insert or delete on TEST
for each row declare
-- local variables here
A NUMBER;
PRAGMA AUTONOMOUS_TRANSACTION; --此处需注意
begin
SELECT COUNT(*) INTO A FROM TEST;
UPDATE TEST_COUNT SET TEST_COUNT = A;
COMMIT; --此处需注意
end T_TEST;