用触发器往表中插入主键和数据


CREATE OR REPLACE TRIGGER TRIGGER_NAME
  AFTER UPDATE OF COLUMN_NAME TABLE_NAME
  FOR EACH ROW

BEGIN
  INSERT INTO T_NAME
    (ID,
     COLUMN_NAME1,
     COLUMN_NAME2,
     COLUMN_NAME3)
  VALUES
    (
     SQUENCE_NAME.NEXTVAL,
     :NEW.COLUMN_NAME1,
     :NEW.COLUMN_NAME1,
     :NEW.COLUMN_NAME1);
END;

你可能感兴趣的:(Oracle)