Saturday, April 5, 2014

API to Delete Previous Employer

DECLARE
   CURSOR c1
   IS
      SELECT * FROM per_previous_employers;
BEGIN
   FOR i IN c1
   LOOP
      BEGIN
         hr_previous_employment_api.
          delete_previous_employer (
            p_validate                => FALSE,
            p_previous_employer_id    => i.previous_employer_id,
            p_object_version_number   => i.object_version_number);
         COMMIT;
         DBMS_OUTPUT.
          put_line (i.previous_employer_id || ' has been deleted ');
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.
             put_line (
                  'Inner Exception: '
               || SQLERRM
               || ' - '
               || i.previous_employer_id);
      END;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);

END;

No comments:

Post a Comment