Search Results okx_opp_headers_v




Overview

OKX_OPP_HEADERS_V is a read-only view owned by the APPS schema in Oracle E-Business Suite, documented as VALID and shipped as part of the OKX – Contracts Integration product. The view exposes a consolidated, reporting-friendly projection of opportunity header data drawn entirely from Oracle Sales (AS) lead records, and is intended to present those records using the generic naming convention expected by the Contracts Integration framework — that is, a header-style interface with a NAME, DESCRIPTION, STATUS, and a set of commercial attributes (currency, amount, decision date, win probability, close reason). It does not store data and performs no joins to secondary tables; it is a single-table projection over AS_LEADS_ALL with a small number of literal and aliased expressions.

Underlying Base Objects

The view is defined exclusively over the synonym AS_LEADS_ALL, which resolves to the Oracle Sales base lead table in the APPS schema. Because the definition is a straight SELECT with no joins, unions, or aggregations, every row returned by OKX_OPP_HEADERS_V corresponds one-to-one with a row in AS_LEADS_ALL. Multi-organization filtering is not enforced within the view text; instead, the ORG_ID column is projected from the base table so that callers can apply their own operating unit or MOAC predicate. The two leading columns are computed literals: ASH.LEAD_ID is aliased to ID1 and a literal '#' string is aliased to ID2. These surrogate identifier columns allow the view to conform to a generic Contracts Integration header interface where two key segments are expected.

Key Columns

  • ID1 — aliased from AS_LEADS_ALL.LEAD_ID; the primary opportunity/lead identifier.
  • ID2 — a literal '#' constant, included to satisfy the two-segment interface key format.
  • NAME — the lead number (LEAD_NUMBER), serving as the business-facing opportunity name.
  • DESCRIPTION, STATUS — the opportunity description and its current status in the sales cycle.
  • CUSTOMER_ID, ADDRESS_ID — the party and location associated with the opportunity.
  • SALES_STAGE_ID — the sales stage reference for pipeline progression.
  • CURRENCY_CODE, TOTAL_AMOUNT — the opportunity currency and its total value.
  • DECISION_DATE, WIN_PROBABILITY — expected close date and forecast confidence.
  • CLOSE_REASON — the reason code recorded when the opportunity was closed; this is the column users most frequently reference, and it is exposed directly from AS_LEADS_ALL.CLOSE_REASON without transformation.
  • ORG_ID — the operating unit identifier, supporting multi-org and MOAC-restricted access.

Common Use Cases and Queries

The view is typically used in Contracts Integration extracts and in reporting that needs a uniform header shape for leads and opportunities, including analysis of why opportunities were won or lost. A representative query filtering on close reason is shown below.

SELECT h.id1, h.name, h.status, h.currency_code, h.total_amount, h.close_reason, h.org_id FROM apps.okx_opp_headers_v h WHERE h.org_id = :p_org_id AND h.close_reason IS NOT NULL ORDER BY h.decision_date DESC;

For pipeline reporting, callers commonly select NAME, SALES_STAGE_ID, WIN_PROBABILITY, and DECISION_DATE, filtering by STATUS to isolate open or closed opportunities. Because the view is defined only over AS_LEADS_ALL, no additional security predicates are applied inside it; any operating unit or responsibility-based restriction must be added by the calling query. Joins to customer, stage, or lookup tables must likewise be supplied by the caller using CUSTOMER_ID, SALES_STAGE_ID, and CLOSE_REASON respectively. The view is read-only and should never be used as a DML target.