Search Results ams_query_template_instance
Overview
AMS_QUERY_TEMPLATE_INSTANCE is a Marketing (AMS) module table that persists query template instance information used by the Oracle EBS Audience Workbench. A query template defines the criteria used to select audience members; an instance represents a concrete materialization of that template within a specific consumer context. The table enforces a simple governance model: there can be only one administrative instance per template, and every subsequent use of the template by a List or similar consumer creates a distinct end-user instance. This design allows the seeded or administrator-defined definition to remain stable while individual lists, campaigns, and segmentation runs hold independent copies that can be inspected, audited, or regenerated.
Under the heuristic Data Vault classification supplied in the ETRM metadata, this table is modeled as standalone. No parent-child hub or link relationships were inferred from the foreign key topology, so it may reasonably be treated as an independent satellite-style record keyed by its own identifier, with descriptive attributes and audit columns attached. The classification is a modeling suggestion only; the operational relationships are still enforced through the foreign keys listed below.
Key Information Stored
The table contains 18 documented columns. The most significant are:
- TEMPLATE_INSTANCE_ID — Surrogate primary key for the instance. Also the leading column of the unique business-key index and the column used to join upward to ASO_SUP_TMPL_INSTANCE.
- TEMPLATE_ID — Identifies the underlying query template that this instance was derived from, enabling grouping of all instances belonging to one template.
- ADMIN_INDICATOR_FLAG — Distinguishes the single administrative instance from end-user instances created each time the template is consumed.
- INSTANCE_USED_BY — Indicates the type of consumer that created the instance, such as a List.
- INSTANCE_USED_BY_ID — The identifier of the specific consuming entity, forming a logical reference to the list, campaign, or segmentation object that owns the instance.
- VIEW_APPLICATION_ID — Application context associated with the instance view, relevant when the template is rendered in a particular application.
- ZD_EDITION_NAME — Partition or edition discriminator, present in the unique index AMS_QUERY_TEMPLATE_INSTANCE_U1 together with TEMPLATE_INSTANCE_ID.
- OBJECT_VERSION_NUMBER — Optimistic locking column used by the Oracle Application Framework for concurrent update control.
- SECURITY_GROUP_ID — Foreign key to FND_SECURITY_GROUPS, enforcing multi-org and function security filtering.
- LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN — Standard who-columns for audit and change tracking.
- REQUEST_ID, PROGRAM_ID, PROGRAM_APPLICATION_ID, PROGRAM_UPDATE_DATE — Concurrent program context columns, populated when the instance is created or refreshed by a batch process.
The unique index AMS_QUERY_TEMPLATE_INSTANCE_U1 on (TEMPLATE_INSTANCE_ID, ZD_EDITION_NAME) is the documented business-key candidate; TEMPLATE_INSTANCE_ID alone acts as the operational primary key.
Common Use Cases and Queries
Typical reporting and diagnostic scenarios include auditing which lists or campaigns have instantiated a query template, verifying that only one administrative instance exists per template, and tracing which concurrent program created a given instance.
- Count instances per template, splitting administrative from end-user records:
SELECT TEMPLATE_ID, SUM(CASE WHEN ADMIN_INDICATOR_FLAG='Y' THEN 1 ELSE 0 END) admin_cnt, SUM(CASE WHEN ADMIN_INDICATOR_FLAG='N' THEN 1 ELSE 0 END) enduser_cnt FROM AMS.AMS_QUERY_TEMPLATE_INSTANCE GROUP BY TEMPLATE_ID; - Locate the consumer of a given instance:
SELECT INSTANCE_USED_BY, INSTANCE_USED_BY_ID, CREATION_DATE FROM AMS.AMS_QUERY_TEMPLATE_INSTANCE WHERE TEMPLATE_INSTANCE_ID = :id; - Trace batch creation:
SELECT TEMPLATE_INSTANCE_ID, REQUEST_ID, PROGRAM_ID FROM AMS.AMS_QUERY_TEMPLATE_INSTANCE WHERE PROGRAM_UPDATE_DATE > :since; - Verify security group assignment: join to FND_SECURITY_GROUPS on SECURITY_GROUP_ID to confirm the instance is visible within the correct operating unit context.
Because the table is standalone and modest in width, it is well suited to standard Oracle BI Publisher extracts and to ad hoc SQL against the AMS schema.
Related Objects
The following objects are the most significant dependencies for this table:
- ASO_SUP_TMPL_INSTANCE — Referenced by AMS_QUERY_TEMPLATE_INSTANCE.TEMPLATE_INSTANCE_ID. It is the primary upstream source for instance definition and the key join path for administrative-instance lookups.
- FND_SECURITY_GROUPS — Referenced by AMS_QUERY_TEMPLATE_INSTANCE.SECURITY_GROUP_ID; governs security-group scoping and multi-org visibility.
- AMS_QUERY_TEMPLATES (logical) — Parent of TEMPLATE_ID, providing the template definition shared across instances.
- AMS_LIST_HEADERS (logical) — The consumer identified by INSTANCE_USED_BY_ID when INSTANCE_USED_BY indicates a List.
- FND_CONCURRENT_REQUESTS — Joined via REQUEST_ID to identify the batch process that created or refreshed an instance.
- FND_APPLICATION — Joined via VIEW_APPLICATION_ID or PROGRAM_APPLICATION_ID to resolve application short names.
-
Table: AMS_QUERY_TEMPLATE_INSTANCE
12.1.1
owner:AMS, object_type:TABLE, fnd_design_data:AMS.AMS_QUERY_TEMPLATE_INSTANCE, object_name:AMS_QUERY_TEMPLATE_INSTANCE, status:VALID, product: AMS - Marketing , description: This table stores the query template instance information in Audience Workbench. There can be only one admin instance and every time the template is used by a List etc, one end user instance is created. , implementation_dba_data: AMS.AMS_QUERY_TEMPLATE_INSTANCE ,
-
Table: AMS_QUERY_TEMPLATE_INSTANCE
12.2.2
owner:AMS, object_type:TABLE, fnd_design_data:AMS.AMS_QUERY_TEMPLATE_INSTANCE, object_name:AMS_QUERY_TEMPLATE_INSTANCE, status:VALID, product: AMS - Marketing , description: This table stores the query template instance information in Audience Workbench. There can be only one admin instance and every time the template is used by a List etc, one end user instance is created. , implementation_dba_data: AMS.AMS_QUERY_TEMPLATE_INSTANCE ,
-
APPS.AMS_QUERY_TEMP_INST_PKG SQL Statements
12.2.2
-
VIEW: AMS.AMS_QUERY_TEMPLATE_INSTANCE#
12.2.2
owner:AMS, object_type:VIEW, object_name:AMS_QUERY_TEMPLATE_INSTANCE#, status:VALID,
-
SYNONYM: APPS.AMS_QUERY_TEMPLATE_INSTANCE
12.1.1
owner:APPS, object_type:SYNONYM, object_name:AMS_QUERY_TEMPLATE_INSTANCE, status:VALID,
-
TRIGGER: APPS.AMS_QUERY_TEMPLATE_INSTANCE+
12.2.2
owner:APPS, object_type:TRIGGER, object_name:AMS_QUERY_TEMPLATE_INSTANCE+, status:VALID,
-
APPS.AMS_QUERY_TEMP_INST_PKG SQL Statements
12.1.1
-
VIEW: AMS.AMS_QUERY_TEMPLATE_INSTANCE#
12.2.2
-
SYNONYM: APPS.AMS_QUERY_TEMPLATE_INSTANCE
12.2.2
owner:APPS, object_type:SYNONYM, object_name:AMS_QUERY_TEMPLATE_INSTANCE, status:VALID,
-
TRIGGER: APPS.AMS_QUERY_TEMPLATE_INSTANCE+
12.2.2
-
FUNCTION: APPS.AMS_QUERY_TEMPLATE_INSTANCE=
12.2.2
-
TABLE: AMS.AMS_QUERY_TEMPLATE_INSTANCE
12.2.2
owner:AMS, object_type:TABLE, fnd_design_data:AMS.AMS_QUERY_TEMPLATE_INSTANCE, object_name:AMS_QUERY_TEMPLATE_INSTANCE, status:VALID,
-
FUNCTION: APPS.AMS_QUERY_TEMPLATE_INSTANCE=
12.2.2
owner:APPS, object_type:FUNCTION, object_name:AMS_QUERY_TEMPLATE_INSTANCE=, status:VALID,
-
PACKAGE BODY: APPS.AMS_QUERY_TEMP_INST_PKG
12.2.2
owner:APPS, object_type:PACKAGE BODY, object_name:AMS_QUERY_TEMP_INST_PKG, status:VALID,
-
PACKAGE BODY: APPS.AMS_QUERY_TEMP_INST_PKG
12.2.2
-
PACKAGE BODY: APPS.AMS_QUERY_TEMP_INST_PKG
12.1.1
-
12.2.2 DBA Data
12.2.2
-
PACKAGE BODY: APPS.AMS_LIST_PURGE_PVT
12.1.1
owner:APPS, object_type:PACKAGE BODY, object_name:AMS_LIST_PURGE_PVT, status:VALID,
-
12.2.2 DBA Data
12.2.2
-
PACKAGE BODY: APPS.AMS_LIST_PURGE_PVT
12.2.2
owner:APPS, object_type:PACKAGE BODY, object_name:AMS_LIST_PURGE_PVT, status:VALID,
-
PACKAGE BODY: APPS.AMS_QUERY_TEMP_INST_PKG
12.1.1
owner:APPS, object_type:PACKAGE BODY, object_name:AMS_QUERY_TEMP_INST_PKG, status:VALID,
-
TABLE: AMS.AMS_QUERY_TEMPLATE_INSTANCE
12.1.1
owner:AMS, object_type:TABLE, fnd_design_data:AMS.AMS_QUERY_TEMPLATE_INSTANCE, object_name:AMS_QUERY_TEMPLATE_INSTANCE, status:VALID,
-
APPS.AMS_LIST_PURGE_PVT SQL Statements
12.2.2
-
PACKAGE BODY: APPS.AMS_ACT_LIST_PVT
12.1.1
owner:APPS, object_type:PACKAGE BODY, object_name:AMS_ACT_LIST_PVT, status:VALID,
-
PACKAGE BODY: APPS.AMS_ACT_LIST_PVT
12.2.2
owner:APPS, object_type:PACKAGE BODY, object_name:AMS_ACT_LIST_PVT, status:VALID,
-
APPS.AMS_LIST_PURGE_PVT SQL Statements
12.1.1
-
12.2.2 DBA Data
12.2.2
-
12.1.1 DBA Data
12.1.1
-
12.2.2 DBA Data
12.2.2
-
12.1.1 DBA Data
12.1.1
-
12.2.2 DBA Data
12.2.2
-
12.2.2 DBA Data
12.2.2
-
12.2.2 FND Design Data
12.2.2
-
12.1.1 FND Design Data
12.1.1
-
12.2.2 DBA Data
12.2.2
-
12.1.1 DBA Data
12.1.1
-
APPS.AMS_LIST_PURGE_PVT dependencies on AMS_QUERY_TEMPLATE_INSTANCE
12.1.1
-
PACKAGE BODY: APPS.AMS_LIST_PURGE_PVT
12.1.1
-
APPS.AMS_LIST_PURGE_PVT dependencies on AMS_QUERY_TEMPLATE_INSTANCE
12.2.2
-
APPS.AMS_ACT_LIST_PVT dependencies on AMS_QUERY_TEMPLATE_INSTANCE
12.2.2
-
PACKAGE BODY: APPS.AMS_LIST_PURGE_PVT
12.2.2
-
APPS.AMS_QUERY_TEMP_INST_PKG dependencies on AMS_QUERY_TEMPLATE_INSTANCE
12.1.1
-
APPS.AMS_QUERY_TEMP_INST_PKG dependencies on AMS_QUERY_TEMPLATE_INSTANCE
12.2.2
-
APPS.AMS_ACT_LIST_PVT dependencies on AMS_QUERY_TEMPLATE_INSTANCE
12.1.1
-
APPS.AMS_LIST_PURGE_PVT dependencies on AMS_QUERY_TEMPLATE_ALL
12.1.1
-
APPS.AMS_QUERY_TEMP_INST_PKG dependencies on AMS_QUERY_TEMPLATE_INSTANCE_S
12.2.2
-
APPS.AMS_LIST_PURGE_PVT dependencies on AMS_QUERY_TEMPLATE_ALL
12.2.2
-
APPS.AMS_LIST_PURGE_PVT dependencies on AMS_QUERY_CONDITION
12.1.1
-
APPS.AMS_QUERY_TEMP_INST_PKG dependencies on AMS_QUERY_TEMPLATE_INSTANCE_S
12.1.1
-
APPS.AMS_LIST_PURGE_PVT dependencies on AMS_QUERY_TEMP_INST_COND_ASSOC
12.1.1