开发者

Trigger and missing option

I'm developing a trigger that has to check the correctness of a date. I'm have big time trouble creating one, becase no matter how I try to simplify my code, Oracle returns me the same error: ORA-00922: missing or invalid option. I have checked the code over and over again and I really can't figure out where my issue is!

The following is an over-simplified version of the trigger, which gets the same error too.

CREATE OR REPLACE checkDateValidity
BEFORE INSERT
ON Event
FOR开发者_如何学编程 EACH ROW
BEGIN
IF :new.month>12
THEN
RAISE_APPLICATION_ERROR(-20101, 'Error: wrong month');
END IF;
END;

I really hope you can help me because at this point I really have no idea of what I am doing wrong.


You are missing the TRIGGER keyword:

CREATE OR REPLACE TRIGGER checkDateValidity
....              ^^^^^^^
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜