-- pers_trig.sql

DROP SEQUENCE person_id
/
CREATE SEQUENCE person_id START WITH 10000
/
CREATE OR REPLACE TRIGGER populate_id
  BEFORE INSERT 
  ON person
  FOR EACH ROW
DECLARE
BEGIN
  -- SELECT person_id.NEXTVAL INTO :new.id FROM dual; -- 10g or earlier
  :new.id := person_id.NEXTVAL; -- 11g
END;
/
