create or replace TRIGGER st_rels BEFORE INSERT ON rels FOR EACH ROW BEGIN SELECT s_rels.nextval INTO :new.p_id FROM dual; END;