Search Results okc_rep_contract_vers_pk




Overview

OKC_REP_CONTRACT_VERS is a Contracts Core (OKC) repository table within Oracle E-Business Suite that stores all previous versions of a contract. Each time a contract is amended, renewed, or otherwise revised in Oracle Contracts, the prior state of the contract header is preserved as a row in this table, keyed by contract identifier and version number. In EBS 12.1.1 and 12.2.2 the table resides in the OKC schema and is documented as VALID with 70 columns in the ETRM 12.2.2 physical schema.

The heuristic Data Vault classification mined from the foreign key structure is link. This suggests the table is best modeled as a relationship-bearing construct that connects a contract entity to its versioned attributes, rather than as a pure hub of business keys or a satellite of descriptive attributes. Practically, it functions as a version history store: the current contract header lives in OKC_REP_CONTRACTS_ALL (or its repository equivalent), while prior versions are archived here.

Key Information Stored

The primary key is OKC_REP_CONTRACT_VERS_PK, defined on (CONTRACT_ID, CONTRACT_VERSION_NUM). A unique index, OKC_REP_CONTRACT_VERS_U1, covers the same column pair and represents the business-key candidate for the versioned contract identity. The most significant columns include:

Common Use Cases and Queries

Typical reporting scenarios include contract version history for audit, comparison of terms across amendments, and reconstruction of the contract state as of a given date. A representative query retrieves all versions for a contract:

  • SELECT contract_number, contract_version_num, contract_status_code, contract_effective_date, contract_expiration_date, amount FROM okc_rep_contract_vers WHERE contract_id = :p_contract_id ORDER BY contract_version_num;
  • Join to OKC_BUS_DOC_TYPES_B on contract_type = bus_doc_type_code to label contract types in version reports.
  • Join to OKC_REP_CONTACT_ROLES_B on notify_contact_role_id to identify notification recipients per version.

Because ORG_ID is present, queries should generally be filtered by operating unit in multi-org environments to avoid cross-org leakage in reports.

Related Objects

  • OKC_REP_CONTRACTS_ALL — current contract header; supplies CONTRACT_ID for version joins.
  • OKC_BUS_DOC_TYPES_B — referenced via CONTRACT_TYPE for document type classification.
  • OKC_REP_CONTACT_ROLES_B — referenced via NOTIFY_CONTACT_ROLE_ID for notification roles.
  • OKC_REP_CONTRACT_VERS child attribute tables (e.g., contract lines, parties) keyed by CONTRACT_ID and CONTRACT_VERSION_NUM.
  • OKC_CONTRACT_PUB and related Contracts Core PL/SQL APIs that write version records during amendment processing.