create or replace procedure sp_fco_upd_pi_pens_proc(pch_compania char,
                                                    psi_anio     number,
                                                    pti_mes      number,
                                                    pch_sucursal char,
                                                    pbi_procesar number) is
  /*************************************************************************/
  -- modulo fiscal colombiano 2.0 adam v3
  -- descripcion: cambio de procesos de planilla integrada pensionados
  -- autor: Manuel Daza
  -- fecha: Noviembre 2006
  -- revisiones:
  /*************************************************************************/
  dummy number(1) := 0;

begin
  begin
    select 1
      into dummy
      from fco_pi_pens_proc
     where compania = pch_compania
       and anio = psi_anio
       and mes = pti_mes
       and sucursal = pch_sucursal;
  exception
    when no_data_found then
      Raise_application_error(-20003, 'el registro a modificar no existe');
      return;
  end;

  update fco_pi_pens_proc
     set procesar = pbi_procesar
   where compania = pch_compania
     and anio = psi_anio
     and mes = pti_mes
     and sucursal = pch_sucursal;

end sp_fco_upd_pi_pens_proc;
/
