FND_FOREIGN_KEYS

FND_FOREIGN_KEYS stores information about the registered foreign keys in your applications. Each row includes the name and a description of the foreign key, the primary key it references, the cascade behavior, the relation, and any special condition. You need one row for each foreign key in each application. Oracle Applications uses this information when installing and upgrading the database

Name Datatype Length Mandatory Comments
APPLICATION_ID NUMBER (15) Yes Application identifier
TABLE_ID NUMBER (15) Yes Table identifier
FOREIGN_KEY_ID NUMBER (15) Yes Foreign key identifier
FOREIGN_KEY_NAME VARCHAR2 (30) Yes Foreign key name
LAST_UPDATE_DATE DATE
Yes Standard Who column
LAST_UPDATED_BY NUMBER (15) Yes Standard Who column
CREATION_DATE DATE
Yes Standard Who column
CREATED_BY NUMBER (15) Yes Standard Who column
LAST_UPDATE_LOGIN NUMBER (15) Yes Standard Who column
PRIMARY_KEY_APPLICATION_ID NUMBER (15) Yes Primary key application identifier
PRIMARY_KEY_TABLE_ID NUMBER (15) Yes Primary key table identifier
PRIMARY_KEY_ID NUMBER (15) Yes Primary key identifier
CASCADE_BEHAVIOR VARCHAR2 (1) Yes Cascade behavior
FOREIGN_KEY_RELATION VARCHAR2 (1) Yes Foreign key relation
DESCRIPTION VARCHAR2 (240)
Description
CONDITION VARCHAR2 (2000)
Condition statement for conditional foreign keys (arc relationships)
ENABLED_FLAG VARCHAR2 (1)
Determines whether this key will be created as an enabled or disabled constraint

Usage


cursor cur_foreign_key(n_tabid in number
                    , n_appid in number)
  -- List the primary key
  is SELECT PRIMARY_KEY_APPLICATION_ID
     ,      PRIMARY_KEY_TABLE_ID
     ,      PRIMARY_KEY_ID
     ,      foreign_key_id
     ,      foreign_key_name
     FROM APPLSYS.FND_FOREIGN_KEYS
     where table_id = n_tabid
     and   application_id = n_appid
     order by foreign_key_name;

cursor cur_fk_refs(n_tabid in number
                 , n_appid in number)
  -- List the primary key
  is SELECT PRIMARY_KEY_ID
     ,      table_id
     ,      application_id
     ,      foreign_key_id
     ,      foreign_key_name
     FROM APPLSYS.FND_FOREIGN_KEYS
     where primary_key_table_id = n_tabid
     and   primary_key_application_id = n_appid
     order by foreign_key_name;