我试图在oracle 10g数据库中创建一个简单的触发器.这个创建触发器的脚本运行干净.
CREATE OR REPLACE TRIGGER newAlert
AFTER INSERT OR UPDATE ON Alerts
BEGIN
INSERT INTO Users (userID, firstName, lastName, password) VALUES ('how', 'im', 'testing', 'this trigger')
END;
/
Run Code Online (Sandbox Code Playgroud)
但是当我跑步时:
INSERT INTO Alerts(observationID, dateSent, message, dateViewed) VALUES (3, CURRENT_TIMESTAMP, 'Alert: You have exceeded the Max Threshold', NULL);
Run Code Online (Sandbox Code Playgroud)
要激活触发器,我收到以下错误消息:
ORA-04098:触发器'JMD.NEWALERT'无效且重新验证失败(受影响的0行)
我不明白什么导致这个错误.你知道导致这个错误的原因吗?或者为什么会这样?
先感谢您!
-大卫