Search Results get_template_id




Overview

GLIQAVG_PKG is a small public PL/SQL package in the APPS schema that supports the Average Balance Inquiry form in Oracle General Ledger. Its header carries the source control identifier $Header: gliqavgs.pls 120.2 2005/05/05 01:19:01 kvora ship $, and the package body was originally created by Kevin Chen on 01-10-96. The package spec is explicitly annotated with the purpose "To contain database functions needed in Average Balance Inquiry form." Functionally, it acts as a session-scoped state holder for drill-down navigation. General Ledger's Average Balance Inquiry allows a user to drill from summarized average balance figures into the source detail, and that drill-down path requires the form to know three context values: the accounting flexfield combination being examined, the row/column template that defined the report layout, and an arithmetic factor applied to the drill-down amounts. GLIQAVG_PKG centralizes those three values as package globals so that the base database view backing the inquiry can read them in its WHERE clause without the form having to paste literals into a dynamic SQL statement. The package is classified in the ETRM metadata as API classification OTHER, reflecting its role as an internal form-support utility rather than a published, supported integration API.

Key Procedures and Functions

The package exposes six documented subprograms, arranged as three setter procedures and three getter functions over the same global variables.

  • SET_CCID — assigns the global code_combination_id. Per the source comments, it "sets the code_combination_id for ar drill down," identifying which accounting flexfield combination the drill-down query should restrict to.
  • SET_TEMPLATE_ID — assigns the global template_id, described as setting the template identifier for the drill-down. The template governs the row and column structure of the average balance inquiry output.
  • SET_FACTOR — assigns the global factor, which scales drill-down amounts. The declared default for this global is 1, so an unscaled inquiry behaves as a pass-through.
  • GET_CCID — returns the stored code_combination_id. The source notes state it is "USED in base view's where part," confirming the getter is called from a view definition rather than from procedural logic.
  • GET_TEMPLATE_ID — returns the stored template_id, and is the function most commonly associated with this package in search queries. It carries the same "used in base view's where part" annotation.
  • GET_FACTOR — returns the stored factor for multiplication against retrieved amounts, again intended for consumption inside a base view.

GET_CCID, GET_TEMPLATE_ID, and GET_FACTOR are each declared with PRAGMA RESTRICT_REFERENCES(..., WNDS, WNPS). The WNDS (write no database state) and WNPS (write no package state) assertions are significant: they certify that the getters do not mutate data, which is what legally permits Oracle to invoke them from within a SQL statement such as a view's WHERE clause. Without these pragmas the functions could not be referenced from SQL at all in this release generation.

Tables Accessed

No base tables are documented as referenced by GLIQAVG_PKG, directly or through APPS synonyms. This is consistent with its design: the package is a pure in-memory state container. Its globals are populated by the Average Balance Inquiry form at runtime and read back by the drift-down base view, which in turn joins the actual General Ledger average balance and accounting flexfield tables. Any table access associated with drill-down occurs in the view and the form's underlying query, not inside this package. Consequently the package performs no DML and requires no table privileges of its own.

Usage Notes

GLIQAVG_PKG is a single-session, form-driven utility. The typical sequence in the Average Balance Inquiry form is: the user requests a drill-down, the form calls SET_CCID, SET_TEMPLATE_ID, and SET_FACTOR to seed the package globals, and the base view then evaluates GET_CCID, GET_TEMPLATE_ID, and GET_FACTOR to filter and scale the returned rows. Because the state lives in package globals, it is scoped to the database session; concurrent users in different sessions do not interfere, but code that reuses a session must reseed the values before each drill-down. The package is documented as referenced by three other packages, indicating that at least some callers invoke the setters programmatically rather than exclusively from the form. Customizations should treat GLIQAVG_PKG as an internal implementation detail: it is not a supported integration point, its parameters and globals are undocumented in the public sense, and Oracle may alter it without notice. Custom code that must reproduce drill-down behavior is better served by querying the underlying average balance objects directly than by manipulating this package's globals. Because the getters carry RESTRICT_REFERENCES pragmas, calling them from SQL is safe and side-effect free.