CREATE TRIGGER newsstory_autoid BEFORE INSERT ON newsstory FOR EACH ROW BEGIN SELECT newsstory_id_seq.nextval INTO :new.id FROM dual; END;