<div class="codebody" id="code56334"> create or replace TRIGGER TRIG_TEST BEFORE INSERT ON TABLE1 FOR EACH ROW DECLARE tmpVar NUMBER; BEGIN tmpVar := 0; Select SEQU_PROC_ASSOCIATEINFO.NextVal into tmpVar from dual; :new.procid:=tmpVar; EXCEPTION WHEN OTHERS THEN -- Consider logging the error and then re-raise RAISE; END;