create or replace trigger ACTION_TYPE_BEFORE_INSUPDT before insert or update on npdes.ACTION_TYPE for each row declare v_Id Number; BEGIN If :new.KeyID Is Null or :new.KeyID < 1 Then select s_npdes_ACTION_TYPE.nextval into v_Id from dual; :new.KeyID := v_Id; End If; End; /To modify mine, put your UPDATE - SQL after the End If line. The first part generates the PK if this is an insert or the records does not have a valid PK [this should never happen except for an insert]. Your update might look like: