Search Results update_cvr_stats
Overview
APPS.FND_FLEX_TRIGGER is a server-side PL/SQL package body belonging to the Oracle E-Business Suite Flexfields architecture. Its principal business function is to maintain the integrity and statistical accuracy of the Key Flexfield validation rule infrastructure. Specifically, the package encapsulates the logic required to keep the FND_FLEX_VALIDATION_RULE_STATS table synchronized whenever validation rules and their associated include or exclude rule lines are created, modified, or removed.
As stated in the source header comments, the trigger-facing entry points in this package are intended to be invoked exclusively from database triggers defined on FND_FLEX_VALIDATION_RULES and FND_FLEX_VALIDATION_RULE_LINES. These triggers are responsible for calling FND_MESSAGE.raise_exception if any of the package functions return an error condition, thereby enforcing transactional consistency at the database layer. The package is classified as OTHER in the ETRM repository and is owned by the APPS schema, which is consistent with its role as a low-level utility supporting the Flexfields engine rather than an end-user facing API.
Key Procedures and Functions
The ETRM documentation for 12.2.2 identifies four documented procedures or functions within this package body:
- UPDATE_CVR_STATS — Updates the FND_FLEX_VALIDATION_RULE_STATS table with counts of new rules, new include rule lines, and new exclude rule lines for a given flexfield structure. If no statistics row exists for the structure, one is created. Negative values may be supplied to indicate deletions, and counts are floored at zero. The procedure also refreshes the last update date to SYSDATE on every invocation, even when no new rules or lines have been added.
- INSERT_RULE_LINE — Handles the insertion of a rule line and the corresponding adjustment of the associated rule statistics.
- UPDATE_RULE_LINE — Handles modifications to an existing rule line along with any required recalculation of statistics.
- DELETE_RULE_LINE — Handles removal of a rule line and decrements the associated statistics accordingly, respecting the non-negative constraint on the counts.
In addition to these public routines, the package body declares several private helper functions, including get_segdelim, get_segcount, and break_segs. The private function break_segs accepts parameters that include a FND_FLEX_SERVER1.StringArray output collection. This StringArray type is the likely point of interest for users searching on the term "to_stringarray," since it reflects the package's internal use of PL/SQL associative array structures to hold parsed concatenated segment values.
Tables Accessed
The package references the following tables through APPS synonyms:
- FND_FLEX_VALIDATION_RULE_STATS — The primary target of the UPDATE_CVR_STATS logic, storing per-structure counts and last update timestamps.
- FND_FLEX_INCLUDE_RULE_LINES and FND_FLEX_EXCLUDE_RULE_LINES — The source tables whose insert, update, and delete operations drive statistics recalculation.
- FND_ID_FLEX_SEGMENTS and FND_ID_FLEX_STRUCTURES — Read to resolve segment delimiters, enabled segment counts, and structural metadata required by the private helper functions.
- DUAL — Used for singleton queries typical of PL/SQL utility logic.
Usage Notes
FND_FLEX_TRIGGER is not ordinarily invoked directly by forms, concurrent programs, or custom code. Its documented callers are the database triggers on the validation rule and rule line tables. The ETRM metadata indicates the package is referenced by seven other packages, confirming that it functions as a shared internal dependency within the Flexfields stack. Customizations that manipulate validation rules through direct DML should rely on the underlying tables' triggers to maintain statistics, rather than calling this package explicitly. Developers investigating StringArray conversions should note that the relevant type is FND_FLEX_SERVER1.StringArray, used within the private segment-breaking routine.
-
APPS.FND_FLEX_TRIGGER SQL Statements
12.2.2
-
APPS.FND_FLEX_TRIGGER SQL Statements
12.1.1
-
PACKAGE BODY: APPS.FND_FLEX_TRIGGER
12.1.1
-
PACKAGE BODY: APPS.FND_FLEX_TRIGGER
12.2.2
-
PACKAGE: APPS.FND_FLEX_TRIGGER
12.2.2
-
PACKAGE: APPS.FND_FLEX_TRIGGER
12.1.1
-
APPS.FND_FLEX_TRIGGER dependencies on FND_MESSAGE
12.1.1
-
APPS.FND_FLEX_TRIGGER dependencies on FND_MESSAGE
12.2.2
-
APPS.FND_FLEX_TRIGGER dependencies on FND_FLEX_EXCLUDE_RULE_LINES
12.2.2
-
APPS.FND_FLEX_TRIGGER dependencies on FND_FLEX_EXCLUDE_RULE_LINES
12.1.1