Search Results foreign_key_sequence




Overview

The OE_DEF_AK_FKEY_COLS_V view is a reporting and integration object owned by the APPS schema in Oracle E-Business Suite, delivered as part of the ONT (Order Management) product family. It exposes metadata about foreign key column definitions registered in the Oracle Application Object Library (AK) repository, presenting a flattened, query-friendly projection of attribute-to-foreign-key column relationships. The view is defined with a status of VALID in both EBS 12.1.1 and 12.2.2.

The view carries no procedural logic and no business transaction data. Its purpose is to make the AK foreign key metadata — which describes how descriptive or extensible attributes are constrained by foreign keys — accessible to SQL-based reporting, diagnostic scripts, and integration routines. Because the view joins object attribute definitions to their corresponding foreign key columns, it is particularly useful when a developer or DBA is investigating referential relationships between flexfield/attribute definitions and the database objects they reference, or searching for a specific FOREIGN_KEY_SEQUENCE value within a composite foreign key.

Underlying Base Objects

The view text is a straightforward two-table join:

  • AK_OBJECT_ATTRIBUTES (referenced in the view via the APPS synonym, aliased B) — the driving table holding attribute-level registration data, including the attribute code, the physical column name, and the database object name.
  • AK_FOREIGN_KEY_COLUMNS (referenced via the APPS synonym, aliased A) — the foreign key definition table holding key name, key column sequence, and the owning attribute identifier.

The join predicate ties the two tables on both ATTRIBUTE_CODE and ATTRIBUTE_APPLICATION_ID, ensuring that an attribute is matched only to foreign key column rows belonging to the same application. The documented referenced base objects confirm the dependency on AK_FOREIGN_KEY_COLUMNS and AK_OBJECT_ATTRIBUTES, both accessed through APPS synonyms. Because the view resolves these synonyms at runtime, it returns only the metadata visible to the connected APPS user.

Key Columns

The view exposes six columns:

  • ATTRIBUTE_CODE — the internal code identifying the attribute in the AK repository; forms half of the join key.
  • ATTRIBUTE_APPLICATION_ID — the application owning the attribute; forms the other half of the join key and scopes the result set by application.
  • COLUMN_NAME — the physical database column associated with the attribute.
  • DATABASE_OBJECT_NAME — the database object (typically a table) on which the column resides.
  • FOREIGN_KEY_NAME — the name of the foreign key constraint to which the column participates.
  • FOREIGN_KEY_SEQUENCE — the ordinal position of the column within the foreign key definition. This is the column most relevant to the search term for which the object was retrieved, and it is the mechanism by which composite (multi-column) foreign keys are ordered.

Common Use Cases and Queries

Typical usage includes validating that foreign key metadata is registered consistently, tracing which repository attributes map to which physical columns, and reconstructing the ordered column list of a composite foreign key. A sample query returning all key columns for a given attribute is:

SELECT attribute_code, foreign_key_name, foreign_key_sequence, column_name, database_object_name, attribute_application_id FROM apps.oe_def_ak_fkey_cols_v WHERE attribute_application_id = :app_id ORDER BY attribute_code, foreign_key_name, foreign_key_sequence;

To locate a specific sequence position within any foreign key:

SELECT foreign_key_name, attribute_code, column_name, foreign_key_sequence FROM apps.oe_def_ak_fkey_cols_v WHERE foreign_key_sequence = 1 ORDER BY foreign_key_name;

Because the view is read-only and confined to metadata, it is safe to query in production for diagnostics. Access should nonetheless be limited to the APPS schema or a suitably privileged reporting user, in line with standard EBS security practice for repository views.