Search Results get_code




Overview

EDW_INSTANCE is an Oracle E-Business Suite PL/SQL package owned by the APPS schema and classified under the ETRM taxonomy as OTHER. Its header declares AUTHID CURRENT_USER, meaning all SQL statements within the package execute with the privileges of the invoking user rather than the definer. The package belongs to the EDW (Enterprise Data Warehouse / E-Business Suite Data Warehouse) family of source-side staging utilities. Its singular documented responsibility is to resolve the identity of the local EBS instance at the point of data extraction. This identity value is a prerequisite for multi-instance warehouse loading, because aggregated warehouse tables must be able to distinguish which source instance contributed a given row of extracted data. The package header carries the RCS identifier $Header: EDWSRINS.pls 115.6 2003/11/19 09:19:37 smulye ship $, indicating an Oracle-standard packaged source file with a version constant exposed alongside the single public function.

Key Procedures and Functions

The package exposes exactly one public function, as documented in ETRM for 12.1.1:

  • GET_CODE — Returns the local instance code for the running EBS database. Its documented purpose is to retrieve the value from the EDW_LOCAL_INSTANCE source. The function takes no input arguments; the returned instance code is described as holding a value derived from the local instance definition and typed as VARCHAR2(30). Because the value identifies "the source site," it establishes the provenance stamp used by downstream warehouse extraction and load programs.

The header applies the pragma PRAGMA RESTRICT_REFERENCES (get_code, WNDS, WNPS, RNPS). This assertion certifies that GET_CODE writes no database state (WNDS), writes no package state (WNPS), and reads no package state (RNPS). The accompanying in-source comment explains the dependency explicitly: RNPS and RNDS guarantees are required so the function remains callable through a view that is accessed across database links. In other words, the purity level is a deliberate design constraint enabling distributed query access to the instance code, not merely a stylistic annotation.

Tables Accessed

ETRM records a single table reference, resolved through an APPS synonym: EDW_LOCAL_INSTANCE. This table acts as the local registry of instance identity — the row (or rows) corresponding to the current database supplies the code returned by GET_CODE. Because the package is declared AUTHID CURRENT_USER, the synonym is resolved and privileges are checked against the caller, so the calling schema must have been granted the appropriate access to the synonym. No other tables, sequences, or DML targets are documented for this package; the function is read-only by contract, consistent with its RESTRICT_REFERENCES pragma and with its role as a lookup service.

Usage Notes

EDW_INSTANCE is a dependency of 52 other documented packages, which makes it a low-level utility whose availability is assumed broadly across the EDW extraction codebase rather than a component invoked directly by end users. It is typically called from EBS-side staging and extraction programs — concurrent programs, warehouse refresh packages, and custom PL/SQL routines — whenever a row must be attributed to its originating instance. Because GET_CODE is pure and link-safe, it is also suitable for exposure through views queried across database links, a capability the source comments explicitly anticipate. Customizations and extensions should call the function rather than hard-coding an instance code, and should preserve the read-only contract so that the RESTRICT_REFERENCES guarantees remain valid.