我使用以下代码
为插入前创建了一个以下触发器CREATE or REPLACE TRIGGER TR_UPDATE_FR_LOGTYPE
BEFORE INSERT
ON LOGSAPDEALSLIPFUNDREQINTGRTN
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
IF (:NEW.RESPONSESTRING IN ('Record already exists') and :NEW.LOGTYPE='ServiceFault') THEN
:NEW.LOGTYPE :='Success';
END IF;
IF (:NEW.RESPONSESTRING is null and :NEW.LOGTYPE is null and :NEW.STATUS is null) THEN
:NEW.STATUS :='T';
END IF;
IF (:NEW.RESPONSESTRING <> null and :NEW.LOGTYPE='Other') THEN
:NEW.STATUS :='S';
END IF;
IF (:NEW.RESPONSESTRING <> null and :NEW.LOGTYPE is null and :NEW.STATUS is null) THEN
:NEW.STATUS :='S';
END IF;
END TR_UPDATE_FR_LOGTYPE;
END
但是错误是
ora 09111无效字符
答案 0 :(得分:1)
我认为必须简单地删除最后一个END:
/* Formatted on 28/02/2017 11:13:38 (QP5 v5.136.908.31019) */
CREATE OR REPLACE TRIGGER TR_UPDATE_FR_LOGTYPE
BEFORE INSERT
ON LOGSAPDEALSLIPFUNDREQINTGRTN
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
IF (:NEW.RESPONSESTRING IN ('Record already exists')
AND:NEW.LOGTYPE = 'ServiceFault')
THEN
:NEW.LOGTYPE := 'Success';
END IF;
IF ( :NEW.RESPONSESTRING IS NULL
AND:NEW.LOGTYPE IS NULL
AND:NEW.STATUS IS NULL)
THEN
:NEW.STATUS := 'T';
END IF;
IF (:NEW.RESPONSESTRING IS NOT NULL AND :NEW.LOGTYPE = 'Other')
THEN
:NEW.STATUS := 'S';
END IF;
IF ( :NEW.RESPONSESTRING IS NOT NULL
AND:NEW.LOGTYPE IS NULL
AND:NEW.STATUS IS NULL)
THEN
:NEW.STATUS := 'S';
END IF;
END TR_UPDATE_FR_LOGTYPE;