Search Results p_worksheet_id




Overview

APPS.PQH_WKS_BUS is the business-layer PL/SQL package for the PQH_WORKSHEETS entity within Oracle E-Business Suite HRMS. It is the public API surface through which the worksheets table is maintained, sitting above the shared table handler (PQH_WKS_SHD) and below the calling form, concurrent program, or custom integration. The package encapsulates the validation logic that governs insert, update, and delete operations against worksheet records, ensuring that the primary key, object version number, and referential relationships remain consistent.

Its scope spans the full lifecycle of a worksheet row. The insertion validation path confirms that the primary key is null on create, since worksheet_id is generated by the application rather than supplied by the caller. The update validation path enforces that worksheet_id cannot be mutated once the row exists; any attempt to change it raises a constraint error against PQH_WORKSHEETS_PK. The delete path confirms that removal is permitted only where dependent budget data does not block the operation. Internally, the package relies on the shared handler's api_updating flag and g_old_rec cursor to distinguish insert from update context and to compare the incoming key against the stored value, using hr_utility.set_location to emit trace points for diagnostics.

Key Procedures and Functions

  • INSERT_VALIDATE — Validates a new worksheet record before it is written. Confirms the primary key is null on insert and that any required attributes are present, so that the surrogate key is generated cleanly by the table handler.
  • UPDATE_VALIDATE — Validates changes to an existing worksheet record. Detects whether the operation is a true update via the shared handler's api_updating flag and raises a constraint error if the primary key has been altered, preventing key corruption.
  • DELETE_VALIDATE — Validates removal of a worksheet record. Confirms the row is in a deletable state and that no dependent budget or budget version rows block the deletion.

A private helper, chk_worksheet_id, supports these validations by inspecting p_worksheet_id together with the object version number. It accepts p_worksheet_id as the primary key of the record being inserted or updated and is documented as internal table handler use only; callers should not invoke it directly.

Tables Accessed

The package references PQH_BUDGETS and PQH_BUDGET_VERSIONS through APPS synonyms. Worksheets define the working area in which budget lines are entered and revised, so the delete and update validation paths must confirm that budget and budget-version rows tied to a worksheet are accounted for before the parent record is altered or removed. Reads against these tables are used for existence and dependency checks rather than for direct data manipulation; the actual DML on the worksheet itself is performed by PQH_WKS_SHD.

Usage Notes

PQH_WKS_BUS is not intended for ad hoc invocation. Under Oracle EBS 12.1.1 and 12.2.2 it is called by the Public Sector/HRMS budget worksheet forms and by the concurrent processes that build, copy, and maintain worksheet definitions. ETRM records three packages referencing it, meaning other business-layer packages depend on its validation contract and expect the standard exception behavior on failure. Custom code that must create or modify worksheets should route through these documented entry points and supply the object version number correctly; direct DML against PQH_WORKSHEETS bypasses the key-integrity and dependency checks enforced here and is not supported.