Search Results okc_terms_var_values_v




Overview

The OKC_TERMS_VAR_VALUES_V view is a reporting and integration object owned by the APPS schema within the Oracle Contracts Core (OKC) module. It exposes the runtime values assigned to business variables that appear within contract terms and articles, joining those values back to their defining variable metadata and to the parent article/document record. In Oracle EBS 12.1.1 and 12.2.2, this view is the primary read-only interface through which developers, report authors, and integration specialists retrieve the resolved variable content stored on contract articles, rather than querying the underlying transaction tables directly.

Because contract variables can be defined once but instantiated many times across documents, the view serves as a denormalized, presentation-friendly layer. Each row represents a single variable value occurrence tied to a specific article (CAT_ID) and document, enriched with the human-readable variable name, description, and datatype from the multilingual variable definition. This makes it well suited to BI Publisher data models, custom concurrent programs, OAF/ADF integration queries, and ad hoc SQL against the APPS schema.

Underlying Base Objects

The view is defined over four documented base objects, all referenced through APPS synonyms:

The join logic keys the value row to the article via CAT_ID, and to both definition tables via VARIABLE_CODE. Note that the join on VARIABLE_CODE rather than a surrogate ID is the defining structural characteristic of this view.

Key Columns

  • ROW_ID — the ROWID of the source variable row, useful for uniquely identifying a value instance.
  • DOCUMENT_ID / DOCUMENT_TYPE — identifies the parent contract document and its type, obtained from the article record.
  • CAT_ID — the contract article ID to which the variable value belongs; joins to OKC_K_ARTICLES_B.ID.
  • VARIABLE_CODE / VARIABLE_NAME / VARIABLE_DESCRIPTION — the code, session-language name, and description of the variable.
  • VARIABLE_TYPE, EXTERNAL_YN, ATTRIBUTE_VALUE_SET_ID — classify the variable, indicate whether it is externally visible, and reference any value set governing its values.
  • VARIABLE_VALUE_ID / VARIABLE_VALUE — the surrogate key and the actual stored value of the variable.
  • VARIABLE_DATATYPE — the datatype of the variable (e.g., text, number, date), critical for casting VARIABLE_VALUE correctly.
  • OBJECT_VERSION_NUMBER, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, LAST_UPDATE_LOGIN — standard audit and concurrency columns.

Common Use Cases and Queries

Typical scenarios include listing all variables and their values for a given document, auditing which articles carry externally visible variables, and joining variable values into contract reporting extracts. Sample SQL:

  • Retrieve values for a specific document:
    SELECT document_id, cat_id, variable_code, variable_name, variable_value, variable_datatype
    FROM   apps.okc_terms_var_values_v
    WHERE  document_id = :p_document_id;
  • Filter to externally visible variables only:
    SELECT variable_code, variable_name, variable_value
    FROM   apps.okc_terms_var_values_v
    WHERE  external_yn = 'Y'
    AND    document_id = :p_document_id;
  • Aggregate usage of a variable code across documents:
    SELECT variable_code, COUNT(*) occurrences
    FROM   apps.okc_terms_var_values_v
    GROUP  BY variable_code;

Because VARIABLE_VALUE is stored generically, consumers should interpret it according to VARIABLE_DATATYPE before applying numeric or date logic.