Wednesday, July 31, 2013

API to Delete Grade

DECLARE
   CURSOR get_grades
   IS
      SELECT *
        FROM per_grades;
       --WHERE grade_id = 2061;
BEGIN
   FOR i IN get_grades
   LOOP
      BEGIN
         hr_grade_api.
          delete_grade (p_validate                => FALSE,
                        p_grade_id                => i.grade_id,
                        p_object_version_number   => i.OBJECT_VERSION_NUMBER);
         COMMIT;
         DBMS_OUTPUT.put_line (i.grade_id || ' has been Deleted !!!');
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.put_line ('Inner Exception: ' || SQLERRM);
      END;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line ('Inner Exception: ' || SQLERRM);
END;

1 comment:

  1. I am getting following error.

    Inner Exception: ORA-20001: PER_7834_DEF_GRADE_DEL_ASSIGN:

    ReplyDelete