Sunday, June 22, 2014

API to Delete Certification Members & Certification

API to Delete Certification Members
DECLARE
   CURSOR c1
   IS
      SELECT *
        FROM ota_certification_members
       WHERE business_group_id = 1627 AND certification_id = 62;
BEGIN
   FOR i IN c1
   LOOP
      BEGIN
         ota_cert_member_api.
          delete_certification_member (
            p_validate                  => FALSE,
            p_certification_member_id   => i.certification_member_id,
            p_object_version_number     => i.object_version_number);
         COMMIT;
         DBMS_OUTPUT.
          put_line (i.certification_member_id || ' has been Zapped !!!');
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.
             put_line (
                  'Inner Exception:  '
               || i.certification_member_id
               || ' - '
               || SQLERRM);
      END;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);
END;

API to Delete Certification
DECLARE
   CURSOR c1
   IS2
      SELECT *
        FROM ota_certifications_b
       WHERE business_group_id = 1627 AND certification_id = 62;
BEGIN
   FOR i IN c1
   LOOP
      BEGIN
         ota_certification_api.
          delete_certification (
            p_certification_id        => i.certification_id,
            p_object_version_number   => i.object_version_number,
            p_validate                => FALSE);
         COMMIT;
         DBMS_OUTPUT.put_line (i.certification_id || ' has been Zapped !!!');
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.
             put_line (
               'Inner Exception:  ' || i.certification_id || ' - ' || SQLERRM);
      END;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);

END;

No comments:

Post a Comment