Search Results set_attach_session_vars




Overview

OKC_VERSION_PVT is a private PL/SQL package in the Oracle E-Business Suite Contracts (OKC) module, owned by the APPS schema and classified as a PVT (private) API. It implements the core versioning engine for Oracle Contracts, allowing users to capture point-in-time snapshots of a contract, save those versions, restore a contract to a previously saved state, and erase versions that are no longer required. The package declares AUTHID CURRENT_USER and includes standard global constants such as G_PKG_NAME, G_APP_NAME, G_UNEXPECTED_ERROR, and the SQL error tokens G_SQLERRM_TOKEN and G_SQLCODE_TOKEN, along with the G_EXCEPTION_HALT_VALIDATION exception. It also defines the subtype cvmv_rec_type based on okc_cvm_pvt.cvmv_rec_type, which carries contract versioning context between the public API layer and this private implementation. As a private package, it is not intended to be called directly by external integrations; instead it is invoked by the public OKC APIs and other internal packages that manage the contract lifecycle.

Key Procedures and Functions

The package exposes six documented procedures that together form the versioning workflow:

  • VERSION_CONTRACT — Creates a new version of a contract. It accepts a CVMV record describing the versioning request and returns an updated CVMV record, using the standard API parameters (p_api_version, p_init_msg_list, x_return_status, x_msg_count, x_msg_data, p_commit).
  • SAVE_VERSION — Persists a version snapshot for a given contract (identified by p_chr_id) so it can later be restored.
  • ERASE_SAVED_VERSION — Removes a previously saved version for a contract, freeing the stored snapshot data.
  • RESTORE_VERSION — Reinstates a contract to the state captured in a saved version, effectively rolling the contract back to that snapshot.
  • DELETE_VERSION — Deletes a contract version record as part of version maintenance.
  • SET_ATTACH_SESSION_VARS — Initializes session-level variables used during the versioning and attachment processing, ensuring consistent context across versioned operations.

All procedures follow the OKC API convention of returning status through x_return_status, x_msg_count, and x_msg_data, with optional commit control via p_commit.

Tables Accessed

The package reads and writes the core contract versioning and condition tables through APPS synonyms. The OKC_CONDITION_HEADERS and OKC_CONDITION_LINES families (base, _B, _BH, _TL, and _TLH variants) store the condition header and line definitions, including their translated and historical (versioned) rows. OKC_CONTACTS and OKC_CONTACTS_H hold contract contact information and its historical snapshot. OKC_COVER_TIMES and OKC_COVER_TIMES_H capture covered time periods for the contract. OKC_CLASS_OPERATIONS and OKC_FUNCTION_EXPR_PARAMS (with its history table) support contract class operations and function expression parameters tied to versioned contract data. These tables are accessed to snapshot, restore, and delete the full set of contract attributes that constitute a version.

Usage Notes

OKC_VERSION_PVT is referenced by 49 other packages, confirming its role as a foundational internal component of the Contracts architecture. It is typically invoked indirectly through the public OKC contract APIs and the Contracts forms, where actions such as "Save Version," "Restore Version," and "Delete Version" trigger the corresponding procedures. Because it is a PVT package, custom code should not call it directly; developers should use the supported public APIs (for example, OKC_API) instead. When troubleshooting versioning behavior in EBS 12.1.1 or 12.2.2, DBAs and developers often search for okc_version_pvt to trace the package responsible for contract snapshot and rollback logic. Any customization that relies on its procedures risks breakage during patching, since private APIs are not covered by Oracle's public API compatibility guarantees.