DECLARE nSeq int; BEGIN EXECUTE 'select nextval(''seqCancelamentoMotivo_Aud'');' INTO nSeq; new.id:= nSeq; return new; END