create or replace TRIGGER st_qcms_types BEFORE INSERT ON qcms_types FOR EACH ROW BEGIN SELECT s_qcms_types.nextval INTO :new.p_id FROM dual; END;