Search Results last_reading




Overview

APPS.OKL_CS_ASSET_COUNTERS_UV is a reporting view within the Oracle E-Business Suite (EBS) 12.1.1 and 12.2.2 ETRM (Enterprise Asset and Contract Management) schema. Its purpose is to present a consolidated, denormalized picture of asset-related counters associated with contract lines and fixed assets. Specifically, it joins contract header and line structures to item instances, counter definitions, counter readings, and fixed asset records, producing a single row per counter reading tied to an asset that is attached to a contract.

The "_UV" suffix conventionally indicates a "User View" intended primarily for reporting and integration consumers rather than direct transactional use. The view exposes contract context, asset identification, item descriptions, counter names, and the latest recorded counter reading, making it well suited for operational dashboards, customer-facing asset reports, and downstream integrations where equipment usage or meter readings must be reconciled against contract and asset master data.

Underlying Base Objects

Per the documented ETRM metadata, the view is defined over a combination of synonym, view, and package base objects, including CSI_ITEM_INSTANCES, CS_COUNTERS, CS_COUNTER_GROUPS, CS_COUNTER_VALUES, FA_ADDITIONS_B, MTL_SYSTEM_ITEMS_VL, MTL_UNITS_OF_MEASURE_VL, OKC_K_HEADERS_B, OKC_K_ITEMS, OKC_K_LINES_B, OKC_LINE_STYLES_B, OKL_CNTR_LVLNG_GRPS_V, OKL_CNTR_LVLNG_LNS_B, and the CSI_COUNTER_READINGS_PVT package.

The view traverses a multi-level contract line hierarchy. It anchors on OKC_K_HEADERS_B and links four OKC_K_LINES_B aliases (CLE1 through CLE4), each tied to a distinct OKC_LINE_STYLES_B style via LTY_CODE. The four line styles used are 'FREE_FORM1', 'FREE_FORM2', 'INST_ITEM', and 'FIXED_ASSET'. The 'INST_ITEM' line connects to OKC_K_ITEMS and then to CSI_ITEM_INSTANCES and MTL_SYSTEM_ITEMS_VL, while the 'FIXED_ASSET' line connects to FA_ADDITIONS_B. Counter data flows from CS_COUNTER_GROUPS to CS_COUNTERS and CS_COUNTER_VALUES (with an outer join to retrieve the latest reading), and the Levelling structures OKL_CNTR_LVLNG_LNS_B and OKL_CNTR_LVLNG_GRPS_V provide consolidated counter naming.

Key Columns

Common Use Cases and Queries

A typical scenario involves listing all counters for assets on a contract, including the latest reading. For example:

SELECT contract_number, asset_number, counter_name, last_reading, last_reading_date
FROM   apps.okl_cs_asset_counters_uv
WHERE  contract_number = :p_contract_number;

Another common query retrieves counters for a specific asset to support billing based on usage:

SELECT counter_name, last_reading, unit_of_measure
FROM   apps.okl_cs_asset_counters_uv
WHERE  asset_number = :p_asset_number;

Because the view applies the outer join and MAX(VALUE_TIMESTAMP) restriction to fetch the latest reading, consumers should be aware that only the most recent valid counter value per counter is returned. The presence of LTY_CODE literal filters ('FREE_FORM1', 'INST_ITEM', 'FIXED_ASSET') within the view definition means the contract structure must conform to the expected line style configuration; otherwise, rows will be omitted. The user's search term "lty_code" corresponds directly to these line style code predicates, which drive the hierarchical joins and determine which contract lines are surfaced by the view.