Search Results var_def




Overview

APPS.OKC_TERMS_VAR_VALUES_V is a reporting and integration view in the Oracle E-Business Suite contracts family of modules (OKC schema prefix). It presents the resolved values of contract variables — the substitutable terms and conditions tokens that drive dynamic clause text within Oracle Contracts and the surrounding ETRM (Enterprise Transaction Resource Management) stack. Each row represents one variable instance attached to a contract article, enriched at query time with the descriptive metadata of the variable definition: its user-facing name, description, data type, and source. The view therefore collapses the transactional side of variable usage (OKC_K_ART_VARIABLES) with the setup side of variable definitions (OKC_BUS_VARIABLES_B and OKC_BUS_VARIABLES_TL) into a single flat structure.

Because it is a view rather than a table, it carries no storage of its own and reflects the current state of the underlying tables. It is read-only in practice and is typically consumed by reports, concurrent programs, and custom integrations that need to display or extract contract variable content without writing multi-table join logic.

Underlying Base Objects

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

The joins are: KART.ID = VAR.CAT_ID, VAR_DEF.VARIABLE_CODE = VAR.VARIABLE_CODE, VAR_DEF.VARIABLE_CODE = VAR_DEF_B.VARIABLE_CODE, and the language filter VAR_DEF.LANGUAGE = USERENV('LANG'). The language predicate is significant: it restricts output to the current session language, so a variable definition must have a translation row in that language or the variable is omitted.

Key Columns

  • ROWID — inherited from OKC_K_ART_VARIABLES; may be used as a unique row identifier.
  • DOCUMENT_ID / DOCUMENT_TYPE — the contract document and its type, sourced from the article.
  • CAT_ID — the article identifier linking the variable to its contract article.
  • VARIABLE_CODE — the definition code that drives the joins to both definition tables.
  • VARIABLE_NAME / DESCRIPTION — translated display text for the variable.
  • VARIABLE_DATATYPE / VARIABLE_SOURCE — the definition's data type and source, useful for validation and rendering.
  • VARIABLE_TYPE — categorizes the variable occurrence.
  • EXTERNAL_YN — indicates whether the variable is externally visible.
  • ATTRIBUTE_VALUE_SET_ID — associates the variable with a value set for validation.
  • VARIABLE_VALUE_ID / VARIABLE_VALUE — the resolved value identifier and the stored value itself.
  • Audit columnsOBJECT_VERSION_NUMBER, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, LAST_UPDATE_LOGIN.

Common Use Cases and Queries

Typical scenarios include extracting contract variable values for a given document, auditing variable usage by definition, and joining to contract headers for reporting. A representative query filtering on the definition code (matching the user's "var_def" interest) is:

  • SELECT document_id, document_type, variable_code, variable_name, variable_value FROM okc_terms_var_values_v WHERE variable_code = :var_def ORDER BY document_id;
  • SELECT variable_code, variable_name, COUNT(*) FROM okc_terms_var_values_v GROUP BY variable_code, variable_name;
  • SELECT document_id, variable_name, variable_datatype, variable_value FROM okc_terms_var_values_v WHERE external_yn = 'Y' AND document_id = :doc_id;

Because the language predicate depends on USERENV('LANG'), reports should be run under the intended language session to ensure all expected variable definitions appear.