Published in: SQL
CREATE OR REPLACE TRIGGER T_INSERT_REGION AFTER INSERT ON LOCATION FOR EACH ROW DECLARE new_region varchar2(200); has_region number; BEGIN new_region := :new.region; SELECT count(*) INTO has_region FROM lu_region WHERE region = new_region; IF (has_region = 0) then INSERT INTO lu_region (region) VALUES (new_region); end IF; END;
You need to login to post a comment.
