Search Results get_currency




Overview

PA_PARALLEL is an Oracle Projects utility package in the APPS schema that supports parallel processing and multi-organization currency resolution within Oracle E-Business Suite. Its two documented entry points serve distinct but complementary infrastructure roles: PA_PARALLEL_AI_RESTART provides restart coordination for parallel workers executing automatic install processing, while GET_CURRENCY returns the functional currency associated with a given operating unit. The package is declared with AUTHID CURRENT_USER, meaning its SQL executes with the privileges of the invoking user rather than the definer, a standard convention for APPS utility packages that must respect the caller's security context. The source header dates the package to the 11i era, and the documented structure is consistent between EBS 12.1.1 and 12.2.2.

Key Procedures and Functions

  • PA_PARALLEL_AI_RESTART — A procedure that manages the restart behavior of a parallel job. It accepts a script name, a worker number, the total number of workers, an action indicator, an IN OUT minimum ID, and a maximum ID. The IN OUT minimum ID allows the procedure to advance the processing watermark for a given worker, which is the classic pattern for chunked parallel processing: each worker claims a range of IDs and the restart logic ensures that interrupted runs resume from the last committed point rather than reprocessing completed rows. The action parameter likely distinguishes initiation, restart, and status operations.
  • GET_CURRENCY — A function returning a VARCHAR2 currency code for a supplied organization identifier (P_org_id, typed against PA_IMPLEMENTATIONS_ALL.ORG_ID). It is annotated with PRAGMA RESTRICT_REFERENCES(get_currency, WNDS, WNPS), declaring that the function writes no database state and packages no state — a requirement for calling the function from SQL statements. This makes GET_CURRENCY usable directly within queries, not merely in PL/SQL.

A package-level collection, G_Curr_Tab of type PA_UTILS.Char15TabTyp, is declared for caching currency codes in session memory, avoiding repeated lookups of the same organization's currency.

Tables Accessed

  • PA_IMPLEMENTATIONS_ALL — The Oracle Projects implementation table keyed by ORG_ID. PA_PARALLEL reads this table to resolve the functional currency for the operating unit passed to GET_CURRENCY. The package-level cache exists precisely to limit repeated reads against this table.
  • PA_PARALLEL_AUTOINSTALL — Referenced by the parallel automatic install logic, this table holds the state used by PA_PARALLEL_AI_RESTART to track worker progress and restart positions.
  • DUAL — Accessed by GET_CURRENCY, most likely to return a cached or default currency value when the organization lookup path does not require a full row fetch, or as part of a conditional SQL expression.

Usage Notes

PA_PARALLEL is an internal integration package and is not exposed through a user-facing form. PA_PARALLEL_AI_RESTART is invoked by concurrent programs or worker scripts that split Oracle Projects automatic install processing across multiple parallel workers; each worker calls the procedure with its assigned worker number and total worker count to obtain its ID range and to register restart checkpoints. GET_CURRENCY is typically called from custom PL/SQL, reports, and data-conversion scripts that need the operating unit currency without joining PA_IMPLEMENTATIONS_ALL directly. Because of the RESTRICT_REFERENCES pragma, it can be embedded in SELECT statements, for example to label project or expenditure rows with the correct functional currency. Developers writing custom code should call GET_CURRENCY rather than querying PA_IMPLEMENTATIONS_ALL themselves, since the function applies the package's caching and organization-resolution rules consistently. No other documented packages reference PA_PARALLEL, confirming its position as a leaf-level utility rather than a shared dependency.