IF EXISTS (SELECT 1 FROM dbo.sysobjects WHERE ID = OBJECT_ID(N'dbo.sp_fco_del_rep_embargos') 
AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
   DROP PROCEDURE dbo.sp_fco_del_rep_embargos
GO
CREATE PROCEDURE dbo.sp_fco_del_rep_embargos
(
  @psi_id_rep  smallint,
  @pvc_usuario varchar(30),
  @pti_cod_rep tinyint
)
/********************************************************************/
/*** 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                                      ***/
/********************************************************************/
--OCT-01-05: DCRP, Pasado a SQL de Oracle
AS
BEGIN
     DELETE fco_reportes_proc
     WHERE id_rep = @psi_id_rep
     AND usuariow = @pvc_usuario
     AND cod_rep = @pti_cod_rep
     
     DELETE fco_embargos_rep
     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
          
END
GO
GRANT EXECUTE ON dbo.sp_fco_del_rep_embargos TO PUBLIC
GO
