Thursday, July 4, 2013

API to Delete Personal Payment Method

DECLARE
   l_effective_start_date   DATE := NULL;
   l_effective_end_date     DATE := NULL;
   l_err_msg                VARCHAR2 (500) := NULL;

   CURSOR c1
   IS
      SELECT * FROM pay_personal_payment_methods_f;
BEGIN
   FOR i IN c1
   LOOP
      BEGIN
         l_effective_start_date := NULL;
         l_effective_end_date := NULL;

         hr_personal_pay_method_api.
          delete_personal_pay_method (
            p_validate                     => FALSE,
            p_effective_date               => SYSDATE,
            p_datetrack_delete_mode        => 'ZAP',
            p_personal_payment_method_id   => i.personal_payment_method_id,
            p_object_version_number        => i.object_version_number,
            p_effective_start_date         => l_effective_start_date,
            p_effective_end_date           => l_effective_end_date);

         COMMIT;

         DBMS_OUTPUT.
          put_line (
            'Personal Pay Method has been Deleted: '
            || i.personal_payment_method_id);
      EXCEPTION
         WHEN OTHERS
         THEN
            l_err_msg := SQLERRM;
            DBMS_OUTPUT.
             put_line (
                  'Inner Exception: '
               || l_err_msg
               || ' '
               || i.personal_payment_method_id);
      END;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      l_err_msg := SQLERRM;
      DBMS_OUTPUT.put_line ('Main Exception: ' || l_err_msg);
END;

1 comment:

  1. Thank you for your API's and other oracle related knowledge. Appreciated

    ReplyDelete