触发器的例子:
CREATE OR REPLACE TRIGGER TR_FK2
BEFORE UPDATE ON BB_MJ_FK2_TB
FOR EACH ROW
BEGIN
IF :OLD.QKJE < NVL(:NEW.FKJE, 0) + NVL(:NEW.ZKJE, 0) THEN
case when UPDATING THEN
RAISE_APPLICATION_ERROR(-20002, '付款金额超出欠款金额!');
END CASE;
END IF;
END;