Search Results okc_template_usages_h




Overview

OKC_TEMPLATE_USAGES_H is a history (audit) table in the OKC — Contracts Core module of Oracle E-Business Suite, owned by the OKC schema. It stores the relationship between a terms template and the document in which that template is used, retaining historical versions of that relationship each time it changes. In effect, it is the archival counterpart to the transactional OKC_TEMPLATE_USAGES table, preserving prior states for auditing, version tracking, and historical reporting across contracts.

The table is registered as VALID in both EBS 12.1.1 and 12.2.2. The documented physical schema contains 30 columns. Based on the foreign key structure mined from the metadata — three distinct references to master/transactional entities — a Data Vault modeling heuristic would suggest classifying this object as a link, since it principally records relationships (template-to-document, document-to-type, document-to-numbering scheme) rather than descriptive attributes of a single business entity.

Key Information Stored

The primary reference in the record is the composite identifying context of the template usage. The columns TEMPLATE_ID, DOCUMENT_ID, and DOCUMENT_TYPE together identify which template was applied to which contract document and of what type. MAJOR_VERSION distinguishes versions of the template usage, while DOC_NUMBERING_SCHEME and DOCUMENT_NUMBER capture the numbering scheme and assigned document number in force at the time of that version.

Lifecycle and audit columns include CREATION_DATE, CREATED_BY, LAST_UPDATE_DATE, LAST_UPDATED_BY, LAST_UPDATE_LOGIN, and OBJECT_VERSION_NUMBER (used for optimistic locking). Business control flags include VALID_CONFIG_YN, AUTOGEN_DEVIATIONS_FLAG, SOURCE_CHANGE_ALLOWED_FLAG, LOCK_TERMS_FLAG, ENABLE_REPORTING_FLAG, and CONTRACT_EXPERT_FINISH_FLAG. Ownership and responsibility are captured via CONTRACT_ADMIN_ID, LEGAL_CONTACT_ID, and LOCKED_BY_USER_ID, with AUTHORING_PARTY_CODE and CONTRACT_SOURCE_CODE indicating origination.

The metadata lists a single unique-index candidate, SYS_IL0000329380C00022$$, which is an XMLType/LONG storage index and does not function as a true business-key surrogate. In practice the version identity is carried by the combination of DOCUMENT_ID, TEMPLATE_ID, and MAJOR_VERSION.

Common Use Cases and Queries

Primary use cases include reconstructing which template applied to a contract at a given point in time, auditing changes to template usage, and reporting template adoption across document types. A typical historical lookup joins templates to their usage:

  • SELECT u.DOCUMENT_ID, u.TEMPLATE_ID, u.MAJOR_VERSION, u.DOCUMENT_NUMBER
  • FROM OKC_TEMPLATE_USAGES_H u
  • WHERE u.TEMPLATE_ID = :template_id
  • ORDER BY u.MAJOR_VERSION, u.LAST_UPDATE_DATE;

To report template usage by document type: join OKC_TEMPLATE_USAGES_H to OKC_BUS_DOC_TYPES_B on DOCUMENT_TYPE and group by document type and template. To trace numbering, join to OKC_NUMBER_SCHEMES_B on DOC_NUMBERING_SCHEME. Because the table is a history store, queries usually filter by DOCUMENT_ID or TEMPLATE_ID and order by MAJOR_VERSION or audit timestamps to select the relevant historical version.

Related Objects

The following objects are referenced by or share keys with this table, per the documented foreign keys:

  • OKC_TERMS_TEMPLATES_ALL — joined on TEMPLATE_ID; the terms template whose usage is recorded.
  • OKC_BUS_DOC_TYPES_B — joined on DOCUMENT_TYPE; classifies the associated document.
  • OKC_NUMBER_SCHEMES_B — joined on DOC_NUMBERING_SCHEME; defines numbering applied to the document.
  • OKC_TEMPLATE_USAGES — the current (non-history) counterpart of this table.
  • OKC_CONTRACTS_ALL / OKC_K_HEADERS — contract header entities linked via document identifiers.
  • OKC_ARTICLES_ALL — articles affected by templates via ARTICLE_EFFECTIVE_DATE context.

Together these relationships let developers and report writers reconstruct the full lifecycle of template application to contract documents across historical versions.