CREATE OR REPLACE PROCEDURE sp_fco_del_rep_embargos_mm
(
  psi_id_rep  number,
  pvc_usuario varchar2,
  pti_cod_rep number
)
/********************************************************************/
/*** Fiscal de Colombia de Data Tecnologia                        ***/
/*** Descripcion: limpia las tablas involucradas en la ejecucion  ***/
/*** del reporte de embargos                                         ***/
/*** Autor:	Diana Cecilia Rios Peinado                            ***/
/*** Fecha:	Mayo 15 de 2005                                      ***/
/********************************************************************/

AS
BEGIN
     DELETE fco_reportes_proc
     WHERE id_rep = psi_id_rep
     AND usuariow = pvc_usuario
     AND cod_rep = pti_cod_rep;
     
     DELETE fco_reportes_mm
     WHERE id_rep = psi_id_rep
     AND usuariow = pvc_usuario
     AND cod_rep = pti_cod_rep;

     DELETE fco_embargos_trans    
     WHERE id_rep = psi_id_rep
     AND usuariow = pvc_usuario
     AND cod_rep = pti_cod_rep;

    DELETE fco_embargos_mm_paso0
    WHERE id_rep = psi_id_rep
      AND usuariow = pvc_usuario
      AND cod_rep = pti_cod_rep;
    
    DELETE fco_embargos_mm_paso
    WHERE id_rep = psi_id_rep
      AND usuariow = pvc_usuario
      AND cod_rep = pti_cod_rep;
          
     COMMIT;
END;
/
CREATE PUBLIC SYNONYM sp_fco_del_rep_embargos_mm FOR ADAM.sp_fco_del_rep_embargos_mm;
GRANT EXECUTE ON sp_fco_del_rep_embargos_mm TO adama;
