您好我已创建了一个触发器,您可以在下面看到,但它会出现以下错误:
ORA-04098: trigger 'APPS.EMP_delete' is invalid and failed re-validation
我的代码:
CREATE OR REPLACE TRIGGER emp_delete
AFTER DELETE
ON EMP
FOR EACH ROW
BEGIN
INSERT INTO history_emp (EMPLOYEE_ID, SALARY, JOB_ID, HIRE_DATE, DEPARTMENT_ID, FIRST_NAME, last_name, DELETED_BY, DELETION_DATE)
VALUES
(:OLD.EMPLOYEE_ID,
:OLD.SALARY,
:OLD.JOB_ID,
:OLD.HIRE_DATE,
:OLD.DEPARTMENT_ID,
:OLD.FIRST_NAME,
:OLD.LAST_NAME,
USER,
SYSDATE);
DELETE FROM BACKUP_EMP WHERE EMPLOYEE_ID = :OLD.EMPLOYEE_ID;
END;
如何解决此错误?
答案 0 :(得分:0)
这意味着你在APPS.EMP_delete'中有一些错误。触发器,不能自动重新评估。你需要检查你的扳机机构是否有任何不妥之处。 例如:是history_emp中所有列的名称是否正确?