CREATE OR REPLACE PROCEDURE DEL_CASCADE_PRATO
(P_CDFILAUXPRAT PRATO.CDFILAUXPRAT%TYPE,
 P_CDPRATO      PRATO.CDPRATO%TYPE ) IS

BEGIN
   DELETE FROM PRATPADR
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
   DELETE FROM PRATTPCARD
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
   DELETE FROM PRATFILI
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
   DELETE FROM PRATSERV
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;

   DELETE FROM RECEPADR
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
   DELETE FROM RECETPCARD
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
   DELETE FROM RECEFILI
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
   DELETE FROM RECESERV
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;

   DELETE FROM PREPPRAPAD
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
   DELETE FROM PREPPRAFIL
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
   DELETE FROM PREPPRASER
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;

   DELETE FROM FOTOPRAPAD
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
   DELETE FROM FOTOPRAFIL
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
   DELETE FROM FOTOPRASER
   WHERE CDPRATO = P_CDPRATO AND
         CDFILAUXPRAT = P_CDFILAUXPRAT;
END;
/