如果插入的记录在表中,我正在尝试检查我的触发器TUTPRAC
包含和CLASSTIME < '9AM' OR > '6PM'
。如果这是真的,那么该记录将更新为某些字段被更改为NULL
。
CREATE TRIGGER CheckBeforeAfterHours
BEFORE INSERT OR UPDATE OF CLASS_TIME ON TUTPRAC
FOR EACH ROW
BEGIN
IF (:NEW.CLASS_TIME < '09:00' OR > '18:00') THEN
:NEW.STAFFNO := NULL;
:NEW.CLASS_DAY := NULL;
:NEW.CLASS_TYPE := NULL;
:NEW.ROOMNUM := NULL;
END IF;
END CheckBeforeAfterHours;
表格的列TUTPRAC
:
CLASSID (PK), UNITCODE, STAFFNO, CLASSDAY, CLASSTIME, CLASSTYPE, ROOMNUM
该字段CLASSTIME
设置为varchar(5)
。
我用Oracle SQLDeveloper
.
问题
我的问题是,当我尝试运行触发器时,我不断收到此错误:
Error(2,36):
PLS-00103: Encountered the symbol ">" when expecting one of the following:
( - + case mod new not null <an identifier> <a double-quoted delimited-identifier>
<a bind variable> continue avg count current exists max min prior sql stddev
sum variance execute forall merge time timestamp interval
date <a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternatively