       -- if found = extra delete function to clean parent, except parent table = :1
       OUTER APPLY (
         SELECT
-          fk.table_name AS clean_parent
+          fk2.table_name AS clean_parent
         FROM
           all_constraints fk
         JOIN

        ) mr
        OUTER APPLY (
          SELECT
            fk.table_name AS clean_parent
          FROM
            all_constraints fk
          JOIN

          ON fka.constraint_name = fk.constraint_name
         AND fka.table_name = fk.table_name
         AND fka.owner = fk.owner
        JOIN
          all_constraints fk2
          ON fk2.constraint_name = fk.r_constraint_name
          AND fk2.owner = fk.owner
        JOIN (
          SELECT
            ctp.table_name,
