Results for “validate_sql”
22 results
AI-generated from documented ETRM metadata — verify critical details on the linked pages.
Overview
APPS.AMS_PARTY_MKT_SEG_LOADER_PVT is a private PL/SQL package within the Oracle E-Business Suite Marketing (AMS) module. It provides the core processing logic for building and maintaining party market segments — the groupings of customers, prospects, and other trading partners that drive targeted marketing campaigns, list generation, and segmentation analytics. The package's central role is to load the AMS_PARTY_MARKET_SEGMENTS table by executing dynamically generated Discoverer SQL against the customer and party model, then persisting the resulting party identifiers as segment members. The _PVT classification indicates this is an internal implementation package intended to be called by public APIs and concurrent programs rather than directly by end users or external integrations. The package header dates to the early releases of the Oracle CRM suite (headers reference 1999–2005), and it remains in the 12.1.1 and 12.2.2 code lines to support the party segmentation features of Oracle Marketing.
Key Procedures and Functions
The package exposes five documented procedures that form a complete segment-processing pipeline:
- REFRESH_PARTY_MARKET_SEGMENT — Designed as a concurrent program entry point. It orchestrates the refresh of a market segment and reports errors back through the standard
errbuf/retcodeconcurrent program output parameters. It accepts an optional cell identifier, allowing refresh of a specific segment cell rather than the entire segment. - LOAD_PARTY_MKT_SEG — Loads the AMS_PARTY_MARKET_SEGMENTS table from the SQL associated with a segment cell. It returns standard EBS error-handling parameters (
x_return_status,x_msg_count,x_msg_data) so that callers can detect and report failures consistently with the Oracle Application Framework error-handling conventions. - VALIDATE_SQL — Validates the Discoverer SQL generated for a segment cell before execution, preventing invalid or malformed queries from being run against the database.
- REFRESH_SEGMENT_SIZE — Recomputes and updates the size (member count) of a segment. This procedure is the object of interest for users searching on "update_segment_size," since it performs the size update logic for a party market segment.
- LOAD_PARTY_MARKET_QUALIFIER — Loads the party market qualifier records that define the criteria a party must satisfy to belong to a given segment.
The package also declares two PL/SQL collection types: sql_rec_type, a table of VARCHAR2(2000) used to hold Discoverer SQL query fragments, and t_party_tab, a table of NUMBER used to hold party identifiers returned by dynamic SQL execution.
Tables Accessed
The package reads and writes several AMS and Oracle Trading Community (HZ/JTF) tables through APPS synonyms:
- AMS_PARTY_MARKET_SEGMENTS and AMS_PARTY_MARKET_SEGMENTS_S — the primary segment membership and size tables updated by the loader and refresh procedures.
- AMS_DISCOVERER_SQL and AMS_ACT_DISCOVERER_ALL — store the Discoverer query definitions associated with segment cells; these supply the dynamic SQL executed by the loader.
- HZ_RELATIONSHIPS and HZ_RELATIONSHIP_TYPES — the party relationship model used to resolve related parties when evaluating segment criteria.
- JTF_SOURCES_ALL, JTF_TERR_ALL, and JTF_TERR_USGS_ALL — source and territory definitions used to qualify parties by source code and territory membership.
- DBMS_SQL, DUAL, and PLITBLM — the built-in dynamic SQL package, the dummy table for validation queries, and the PL/SQL table utility package.
Usage Notes
This package is invoked indirectly. The Refresh_Party_Market_Segment procedure is registered as a concurrent program and is scheduled from the Marketing responsibility to rebuild segment membership on demand or periodically. Oracle Marketing and iStore segment definition flows call the loader procedures when a user creates or edits a segment cell containing a Discoverer-based query. Because the package is classified as PVT, direct calls from custom code are unsupported; customizations should instead use the public AMS segment APIs or invoke the concurrent program. The refresh_segment_size procedure is the relevant entry point when the size of an existing segment must be recalculated without a full membership reload, making it the typical resolution path for requests to "update segment size" in EBS 12.1.1 and 12.2.2 environments.