Oracle will try to recompile invalid objects as they are referred to. Here the trigger is invalid, and every time you try to insert a row it will try to recompile the trigger, and fail, which leads to the ORA-04098 error.
You can select * from user_errors where type = 'TRIGGER' and name = 'NEWALERT'
to see what error(s) the trigger actually gets and why it won't compile. In this case it appears you're missing a semicolon at the end of the insert
line:
INSERT INTO Users (userID, firstName, lastName, password)
VALUES ('how', 'im', 'testing', 'this trigger')
So make it:
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;
/
If you get a compilation warning when you do that you can do show errors
if you're in SQL*Plus or SQL Developer, or query user_errors
again.
Of course, this assumes your Users
tables does have those column names, and they are all varchar2
... but presumably you'll be doing something more interesting with the trigger really.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…