Thursday, March 27, 2014

API to Delete Booking Justifications

DECLARE
   CURSOR c1
   IS
      SELECT *
        FROM ota_bkng_justifications_b
       WHERE business_group_id = 1107;
BEGIN
   FOR i IN c1
   LOOP
      BEGIN
         OTA_BKNG_JUSTIFICATION_API.
          DELETE_BOOKING_JUSTIFICATION (
            p_booking_justification_id   => i.booking_justification_id,
            p_object_version_number      => i.object_version_number,
            p_validate                   => FALSE);
         COMMIT;
         DBMS_OUTPUT.
          put_line (i.booking_justification_id || ' has been deleted ');
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.
             put_line (
                  'Inner Exception: '
               || SQLERRM
               || ' - '
               || i.booking_justification_id);
      END;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);

END;

No comments:

Post a Comment