Search Results get_from_id




Overview

The APPS.HR_H2PI_MAP package is a utility API within Oracle E-Business Suite Human Resources that maintains an identity cross-reference between legacy or external identifiers and their corresponding Oracle HRMS primary keys. It operates on the HR_H2PI_ID_MAPPING table, which stores the pairing of a "from" identifier (typically originating in an external or pre-conversion source system) and a "to" identifier (the surrogate key assigned by Oracle HRMS). The package name reflects the "HR to PI" (Human Resources to a downstream or prior interface) mapping concept, and it is classified as an OTHER API rather than a public, fully supported business API.

The package is declared AUTHID CURRENT_USER, meaning that its SQL executes with the privileges of the invoking schema rather than the defining schema. This design is significant: it allows the caller's security context to govern access to the mapping table and any referenced objects, which is appropriate for a low-level mapping utility used during data migration, conversion, and integration routines.

Key Procedures and Functions

  • CREATE_ID_MAPPING — Accepts a table name and a pair of identifiers (a "from" value and a "to" value) and inserts the corresponding mapping row into the mapping table. It is the entry point used to establish a new cross-reference relationship.
  • GET_TO_ID — Given a table name and a "from" identifier, returns the associated "to" identifier. An optional parameter controls whether an error is raised when no mapping exists, allowing callers to either treat a miss as an exception or handle it gracefully.
  • GET_FROM_ID — Performs the inverse lookup: given a table name and a "to" identifier, it returns the original "from" identifier. Like GET_TO_ID, it includes an optional error-reporting flag.

Together the three routines provide a complete bidirectional translation service between external and internal identifiers.

Tables Accessed

The package reads and writes HR_H2PI_ID_MAPPING (accessed through an APPS synonym). This table is the sole documented data store. It is keyed by table name plus identifier, allowing a single physical table to hold mappings for multiple source objects. CREATE_ID_MAPPING performs inserts, while GET_TO_ID and GET_FROM_ID perform the lookups that resolve identifiers in either direction.

Usage Notes

Because it is an OTHER-classified package, HR_H2PI_MAP is generally invoked from custom PL/SQL conversion scripts, interface programs, or concurrent programs rather than from standard Oracle forms. It is referenced by five other packages, indicating that it functions as a shared dependency within the HR data-conversion and integration layer. Typical scenarios include migrating employee, assignment, or applicant records from a legacy system, where the legacy key must be retained and mapped to the newly generated Oracle HRMS primary key for subsequent reconciliation or downstream processing. Developers should note that it is not a documented public API: reliance on it carries the usual risks of internal utility use, and it should be invoked only where the underlying mapping table is already populated and the security context permits access.