再来一个蟹发器示例,这个简单点

create or replace TRIGGER "abcd".TUNNEL_HISTORY_TRIGGER
    BEFORE INSERT
    ON TUNNEL_HISTORY
    FOR EACH ROW
DECLARE
        next_id NUMBER;
BEGIN
  SELECT TUNNEL_HISTORY_SEQUENCE.NEXTVAL
  INTO next_id
  FROM dual;
  :NEW.HISTORY_ID := next_id;
END;

你可能感兴趣的:(职场,休闲)