Search This Blog

Wednesday, May 16, 2012

Delete Organization Information in Oracle HRMS

DECLARE
   ln_ovn   NUMBER := 1;
   CURSOR c
   IS
      SELECT org_information_id, object_version_number
        FROM hr_organization_information
       WHERE TRUNC (creation_date) = TRUNC (SYSDATE)
         AND org_information_context = 'XX_ORG_ROLES'
      UNION
      SELECT org_information_id, object_version_number
        FROM hr_organization_information
       WHERE org_information_context = 'XX_ORG_ROLES'
         AND TRUNC (creation_date) = '01-May-2012';
BEGIN
   FOR i IN c
   LOOP
      ln_ovn := i.object_version_number;
      hr_organization_api.delete_org_manager
                               (p_validate                   => FALSE,
                                p_org_information_id         => i.org_information_id,
                                p_object_version_number      => ln_ovn
                               );
   END LOOP;
END;

No comments:

Post a Comment