0
您好我已經創建了一個觸發器,你可以看到波紋管的下方,但它給了以下錯誤:ORA-04098:觸發器「triggername」是無效的,失敗再驗證
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;
如何修復此錯誤?
創建觸發器時會出現什麼錯誤?或者當你查詢'user_errors'? –
執行以下操作並將結果粘貼到問題B編輯中。 'SELECT * FROM \t user_errors WHERE type ='TRIGGER'AND name ='EMP_DELETE';' – user75ponic