Search Results delete_saved_version




Overview

OKS_CONTRACT_HDR_PUB is the public API package for Oracle Service Contracts (OKS) header maintenance within Oracle E-Business Suite, delivering the same core service contract functionality in both release 12.1.1 and 12.2.2. The package exposes the business logic that creates, modifies, validates, versions, and deletes service contract headers stored in the OKS_K_HEADERS tables. It is declared with AUTHID CURRENT_USER, meaning that privilege resolution occurs under the invoking schema — a design that requires the calling user to hold appropriate grants on the underlying objects. The declaration section defines the khrhv_rec_type record, which mirrors the columns of the OKS_K_HEADERS_V view and initializes each attribute to the OKC_API.G_MISS_NUM, G_MISS_CHAR, or G_MISS_DATE sentinel. This record type is the primary mechanism by which callers pass header attribute values into the API, and the sentinel defaults allow the API to distinguish between "not supplied" and "explicitly set to null" during validation and DML processing.

Key Procedures and Functions

The package publishes 23 documented procedures and functions, including the following core operations:

  • CREATE_HEADER — Inserts a new service contract header, applying validation rules and defaulting logic before committing the record.
  • UPDATE_HEADER — Modifies an existing header, distinguishing changed attributes from unsupplied ones via the G_MISS sentinels.
  • DELETE_HEADER — Removes a contract header, subject to status and referential integrity checks.
  • VALIDATE_HEADER — Performs business rule validation on header data without persisting changes.
  • LOCK_HEADER — Obtains a lock on the header record to serialize concurrent modifications.
  • CREATE_VERSION / SAVE_VERSION / DELETE_SAVED_VERSION / RESTORE_VERSION / DELETE_HISTORY — Support the versioning model, allowing a contract to be snapshotted, saved, restored, or purged from history.
  • INSERT_ROW_UPG — Inserts a header row as part of upgrade processing.
  • CREATE_HDR_VERSION_UPG — Creates a header version during an upgrade or data migration, invoked by the upgrade driver rather than by ordinary runtime transactions.

Tables Accessed

The package reads and writes the service contract header and line base, history, and translation tables. OKS_K_HEADERS_B and OKS_K_HEADERS_BH hold the base and historical header rows, while OKS_K_LINES_B, OKS_K_LINES_BH, OKS_K_LINES_TL, and OKS_K_LINES_TLH hold associated contract lines and their translated descriptions. OKC_K_VERS_NUMBERS participates in version numbering, and PLITBLM serves as a PL/SQL index-by table utility used for bulk processing. Access is made through APPS synonyms.

Usage Notes

OKS_CONTRACT_HDR_PUB is invoked from the Service Contracts forms, from concurrent programs performing contract maintenance or upgrades, and from custom PL/SQL code. It is referenced by 13 other packages, so changes to its behavior propagate widely. Because the package is AUTHID CURRENT_USER, callers must be granted direct privileges on the underlying tables. The CREATE_HDR_VERSION_UPG routine, which matches the user's search term "create_hdr_version_upg," is specifically intended for upgrade and migration scripts rather than day-to-day contract entry.