Thursday, March 27, 2014

API to Delete Booking Status Types

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

END;

No comments:

Post a Comment