我的触发器有什么问题?我使用 toad for oracle
执行此 sql toad 后显示此消息,不再显示!:
Warning: compiled but with compilation errors
并且触发器不起作用
我的触发器在这里:
CREATE OR REPLACE TRIGGER trg_delete_mmtp_user_feature
BEFORE DELETE
ON mmtp_user
FOR EACH ROW
BEGIN
-- for these cases delete not allowed
IF ((SELECT COUNT (*)
FROM payment p INNER JOIN mmtp_user mt
ON mt.customer_id = p.requester_id
WHERE p.rp_reason_id = 20 AND mt.mmtp_user_id = :OLD.mmtp_user_id) >
0
)
THEN
raise_application_error
(-20654,
'Query has attempted to delete MMTP_USER with existing payment'
);
ELSE --befor deleting features should be deleted
DELETE FROM mmtp_user_feature
WHERE mmtp_user_id = :OLD.mmtp_user_id;
END IF;
END;
/
并删除我收到此消息:
ORA-04098: trigger 'DEVX2.TRG_DELETE_MMTP_USER_FEATURE' is invalid and failed re-validation