create sequence seq_tablename
start with 1
increment by 1;
create or replace trigger tri_tablename_insert
before insert on tablename
referencing old as old new as new
for each row
begin
select seq_tablename.nextval
into :new.ID
from dual;
end tri_tablename_insert;