Search Results okc_terms_local_var_v




Overview

OKC_TERMS_LOCAL_VAR_V is an APPS-owned view in the Oracle Contracts Core (OKC) module. It exposes locally defined contract terms variables that are associated with individual articles within contract documents. The view resolves local (non-global) business variables and joins them to their language-specific definitions, article metadata, and article text. Its central purpose is to make contract variable values readable in a flattened, report-friendly form without requiring the caller to resolve the OKC_BUS_VARIABLES_B / OKC_BUS_VARIABLES_TL lookup relationship manually.

Because the view filters on VAR_DEF_B.VARIABLE_TYPE = 'U', it returns user-defined variables only, distinguishing them from system or predefined variables. It also suppresses deleted articles via the NVL(KART.AMENDMENT_OPERATION_CODE, '?') <> 'DELETED' predicate and restricts the translation row to the session language through VAR_DEF.LANGUAGE = USERENV('LANG'). The presence of the VARIABLE_VALUE and VARIABLE_VALUE_ID columns makes this view the primary reference point when searching for how a specific term value is stored and surfaced.

Underlying Base Objects

The view is defined over five synonyms and references two packaged APIs in its select list:

  • OKC_K_ART_VARIABLES — the driving base table, aliased VAR, holding the actual variable instances, their values, and the owning contract article.
  • OKC_BUS_VARIABLES_B — aliased VAR_DEF_B, supplying the variable datatype and used to constrain to user-defined variables.
  • OKC_BUS_VARIABLES_TL — aliased VAR_DEF, supplying the translated variable name and description.
  • OKC_K_ARTICLES_B — aliased KART, providing the article, section, document type, and document identity.
  • OKC_ARTICLE_VERSIONS — aliased V, providing article text and additional instructions.
  • OKC_TERMS_UTIL_PVT — a package invoked for GET_ARTICLE_NAME and GET_SECTION_LABEL.
  • OKC_K_ENTITY_LOCKS_GRP — a package contributing locking behavior to the OKC entity model.

Key Columns

Common Use Cases and Queries

Typical scenarios include retrieving all user-defined variable values for a contract, reporting article text alongside resolved variable values, and reconciling local overrides against global definitions.

SELECT variable_code, variable_name, variable_value, variable_datatype
FROM   apps.okc_terms_local_var_v
WHERE  document_id = :p_document_id;
SELECT section_label, article_name, variable_code, variable_value
FROM   apps.okc_terms_local_var_v
WHERE  variable_value_id = :p_value_id;

Because DOCUMENT_TYPE and DOCUMENT_ID are exposed, the view can be joined directly to contract header tables for cross-document reporting. Filtering by EXTERNAL_YN = 'Y' isolates externally visible terms, and ORDER BY SECTION_ID, ARTICLE_VERSION_ID preserves the document's natural reading sequence when listing variable values.