日期:2014-05-17 浏览次数:20707 次
/* Formatted on 2011/11/22 10:54 (Formatter Plus v4.8.8) */ CREATE OR REPLACE TRIGGER tri_a_i BEFORE INSERT ON a FOR EACH ROW DECLARE v_count NUMBER; BEGIN SELECT COUNT (d_code) INTO v_count FROM b WHERE d_code = :NEW.d_code; IF v_count = 0 THEN INSERT INTO b (d_code, d_name ) VALUES (:NEW.d_code, :NEW.d_name ); END IF; EXCEPTION WHEN OTHERS THEN NULL; END;