create or replace PROCEDURE DEL_MRP
   (P_CDFILIAL  IN FILIAL.CDFILIAL%TYPE,
    P_DTMRP     IN PROGPRODU.DTPROGPRODU%TYPE) IS
BEGIN

   DELETE FROM PEDIDOMRP
   WHERE CDFILIAL = P_CDFILIAL AND
         DTHRPEDIDOMRP = P_DTMRP;

   DELETE FROM SOLICITAMRP
   WHERE CDFILIAL = P_CDFILIAL AND
         DTHRSOLICITAMRP = P_DTMRP;

   DELETE FROM PREMATPPROGP
   WHERE CDFILIAL     = P_CDFILIAL  AND
         DTPROGPRODMP = P_DTMRP;

   DELETE FROM CALENDEQUIPAPRO
   WHERE CDFILIAL = P_CDFILIAL AND
         DTPROGUTEQUIP = P_DTMRP;

   DELETE FROM PROGAGRUPSEMI
   WHERE CDFILIAL = P_CDFILIAL AND
         DTPROGPRODU = P_DTMRP;

   DELETE FROM PREAGRUPSEMICALE
   WHERE CDFILIAL = P_CDFILIAL AND
         DTPROGPRODCP = P_DTMRP;

   DELETE FROM CALEPRODMRP
   WHERE CDFILIAL     = P_CDFILIAL  AND
         DTPROGPRODCP = P_DTMRP;

   DELETE FROM PROGPRODU
   WHERE CDFILIAL     = P_CDFILIAL  AND
         DTPROGPRODU  = P_DTMRP;
END;
/

