CREATE OR REPLACE TRIGGER PROCESS_POPULATE_INSTANCE
AFTER INSERT OR UPDATE ON PROCESS_INSTANCE
FOR EACH ROW
DECLARE
InstanceExists NUMBER;
BEGIN
SELECT COUNT(*)
INTO InstanceExists
FROM TEST_PROCESSDATA
WHERE TEST_PROCESSDATA.PROCESS_INSTANCE_ID = :NEW.INSTANCE_ID ;
IF ( InstanceExists > 0 ) THEN
UPDATE TEST_PROCESSDATA SET PROCESS_STATUS =:NEW.STATUS WHERE PROCESS_INSTANCE_ID = NEW.INSTANCE_ID;
ELSIF
INSERT INTO TEST_PROCESSDATA (PROCESS_INSTANCE_ID,PROCESS_STATUS, STARTED_TIME) VALUES (:NEW.INSTANCE_ID,:NEW.STATUS,:NEW.START_TIME);
END IF;
END PROCESS_POPULATE_APPDATA;
在执行上述触发器时,我收到以下错误:
错误(12,2):PLS-00103:在预期以下情况之一时遇到符号“INSERT”:(-+ case mod new not null continue avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval
日期管道
错误(13,2):PLS-00103:遇到符号“END”