Search Results set_globals




Overview

OKE_GLOBALS is a lightweight PL/SQL package in the Oracle E-Business Suite APPS schema whose sole purpose is to hold and expose a single session-level global variable, G_K_Header_ID. Rather than storing this value in a database table, the package uses a package-level variable that persists for the duration of a database session. This is a deliberate design pattern in EBS: it allows forms, concurrent programs, and other PL/SQL units running within the same session to share a key identifier (the Contract Header ID for the Oracle Contracts / OKE module) without the overhead of repeated queries to the persistent header table. The package header and body are minimal — one private variable, one setter procedure, and one getter function — which makes its role purely infrastructural rather than business-logic-bearing.

Key Procedures and Functions

  • SET_GLOBALS — A procedure that assigns the incoming Contract Header ID to the package-level global G_K_Header_ID. It performs no validation, no database access, and no error handling; it is a simple assignment. It is the only way to populate the global, so any session that relies on K_HEADER_ID must call SET_GLOBALS first with a meaningful value.
  • K_HEADER_ID — A function that returns the current value of G_K_Header_ID. If SET_GLOBALS has not been invoked in the current session, the value is NULL (the variable's initialization state), so callers should be prepared to handle a NULL return. No parameters are documented for this function.

Tables Accessed

Per the ETRM metadata, OKE_GLOBALS references no tables through APPS synonyms, and the source listing confirms this — the package body contains only the variable declaration, the setter, and the getter. There are no SELECT, INSERT, UPDATE, or DELETE statements. This absence of table access is intentional: the package exists precisely to avoid repeated reads of the OKE contract header table by caching the header ID in session memory. Any persistence or retrieval of the actual header record is the responsibility of other OKE packages that call SET_GLOBALS after fetching the row themselves.

Usage Notes

This package is typically invoked early in a session's processing flow. A caller (for example, an OKE form, an OKE concurrent program, or a wrapper PL/SQL block) retrieves the Contract Header ID from the underlying header table and calls SET_GLOBALS to publish it. Subsequent routines in the same session then call K_HEADER_ID to recover the value without re-querying. The metadata indicates OKE_GLOBALS is referenced by one other package, confirming the pattern: a single consumer package reads the global to drive its own processing. Because the variable is scoped to the session, its value is not shared across sessions, and concurrent programs that reuse database sessions may see stale values unless SET_GLOBALS is called again. Custom code extending OKE functionality can use the same pattern, provided SET_GLOBALS is called before any K_HEADER_ID reference. On Oracle EBS 12.1.1 and 12.2.2, the Online Patching (ADOP) architecture in 12.2.2 has no bearing on this package's behavior, since it holds no persistent state; typical invocations are through the OKE forms runtime or OKE concurrent program wrappers rather than through a direct user-facing API.