create or replace trigger TRG_SEQ_ID before insert on TABLE1 for each row declare begin if :new.ID>0 then return; else select SEQ_ID.Nextval into :new.ID from dual; end if; end TRG_SEQ_ID;