Results for “oks_document_versions_v”

26 results




AI-generated from documented ETRM metadata — verify critical details on the linked pages.

Overview

OKS_DOCUMENT_VERSIONS_V is a documented view owned by the APPS schema in Oracle E-Business Suite, registered with a VALID status and delivered as part of the OKS — Service Contracts product family. Its stated purpose in the ETRM metadata is to provide archived versions of a contract. In practice the view acts as a unified listing of contract document versions, identifying for each contract whether a given major version exists only as an archived copy or is still held as a "live" version record. This distinction is essential to version-aware reporting across Service Contracts.

The view carries a product tag of 'OKS' via its DOCUMENT_TYPE column, meaning it is scoped to Service Contracts content rather than the broader Oracle Contracts (OKC) document set. Consumers — including custom reports, concurrent programs, and integration extracts — use it to enumerate contract versions without having to join the version-numbering table and the header base/archive tables directly. It is a read-only object; no DML is permitted against a view of this construction.

Underlying Base Objects

The view is defined over four documented referenced objects:

  • OKC_K_HEADERS_BH — the archive ("history") table for contract headers. Supplied as the first table in the first branch of the UNION.
  • OKC_K_HEADERS_B — the current/base contract header table. Used in the second branch of the UNION.
  • OKC_K_VERS_NUMBERS — the version-numbering table recording existing major versions for a contract. Used both in the NOT EXISTS anti-join and in the second UNION branch.
  • OKC_SUBCLASSES_V — a view over contract subclasses, filtering on CLS_CODE = 'SERVICE'.

The structure is a UNION of two result sets. The first set draws major versions from the archive table OKC_K_HEADERS_BH where no matching row exists in OKC_K_VERS_NUMBERS for that ID and version; these rows are flagged ARCHIVED_YN = 'Y'. The second set draws live versions from OKC_K_VERS_NUMBERS joined to OKC_K_HEADERS_B, flagged ARCHIVED_YN = 'N'. Both branches restrict results to Service Contracts subclasses through OKC_SUBCLASSES_V.

Key Columns

  • DOCUMENT_ID — the contract header identifier (HDR.ID from OKC_K_HEADERS_BH, or VER.CHR_ID from OKC_K_VERS_NUMBERS). This is the CHR_ID used throughout OKS and OKC.
  • DOCUMENT_TYPE — a literal value 'OKS', denoting Service Contracts as the owning application.
  • MAJOR_VERSION — the major version number of the contract document, sourced from the header archive or the version-numbering table.
  • ARCHIVED_YN — a flag: 'Y' indicates the version exists only in the archived header table, 'N' indicates a current version recorded in OKC_K_VERS_NUMBERS.

Common Use Cases and Queries

Typical usage includes reconciliation of archived versus live contract versions, reconstruction of contract version history for audit, and feeds that require a flat list of document versions per contract. Because the view is Service Contracts scoped, queries are often filtered by DOCUMENT_ID to inspect a single contract's version profile:

  • List all versions of a contract: SELECT major_version, archived_yn FROM oks_document_versions_v WHERE document_id = :p_chr_id ORDER BY major_version;
  • Count archived versions per contract: SELECT document_id, COUNT(*) FROM oks_document_versions_v WHERE archived_yn = 'Y' GROUP BY document_id;
  • Identify contracts with no live version: SELECT document_id FROM oks_document_versions_v WHERE archived_yn = 'N' GROUP BY document_id HAVING COUNT(*) = 0;

If the view's performance appears low, an efficient drill-down is available by querying OKC_K_HEADERS_B, OKC_K_HEADERS_BH, and OKC_K_VERS_NUMBERS directly with the same predicates. The user's search for okc_k_headers_bh is directly relevant here: that archive table is the source of the 'Y' (archived) rows in this view.