tilføje ;
i slutningen af dine suffiksforespørgsler
ELSIF :NEW.suffix = '' THEN
SELECT MAX(suffix)+1 INTO :NEW.suffix
FROM tb1 WHERE reportnum = :NEW.reportnum;
ELSIF :NEW.suffix = NULL THEN
SELECT MAX(suffix)+1 INTO :NEW.suffix
FROM tb1 WHERE reportnum = :NEW.reportnum;
Du kan også reducere antallet af if-udsagn for begge ved at gøre dette:For eksempel:
IF coalesce(:NEW.reportnum,-1) = -1 THEN
SELECT seq1.NEXTVAL INTO :NEW.reportnum FROM dual;
ELSIF coalesce(:NEW.suffix,-1) = -1 THEN
SELECT MAX(suffix)+1 INTO :NEW.suffix
FROM tb1 WHERE reportnum = :NEW.reportnum;
END IF;