FND_PRIMARY_KEYS
FND_PRIMARY_KEYS stores information about the registered primary and unique keys in your applications. Each row includes the name and a description of the primary or unique key. Each row also includes the table the key references, the type of the key (Primary or Unique), and whether the key is the Developer (DataMerge) key. You need one row for each primary or unique key in each application. Oracle Applications uses this information for AuditTrail and 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 |
PRIMARY_KEY_ID | NUMBER | (15) | Yes | Primary key identifier |
PRIMARY_KEY_NAME | VARCHAR2 | (30) | Yes | Primary 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_TYPE | VARCHAR2 | (1) | Yes | Primary key type (Developer or Alternate) |
AUDIT_KEY_FLAG | VARCHAR2 | (1) | Yes | Flag to indicate if this key is the primary key |
DESCRIPTION | VARCHAR2 | (240) | Description | |
ENABLED_FLAG | VARCHAR2 | (1) | Determines whether this key will be created as an enabled or disabled constraint |
Usage:
cursor cur_primary_key(n_tabid in number
, n_appid in number)
-- List the primary key
is SELECT PRIMARY_KEY_ID
, PRIMARY_KEY_NAME
, PRIMARY_KEY_TYPE
, ENABLED_FLAG
FROM APPLSYS.FND_PRIMARY_KEYS
where table_id = n_tabid
and application_id = n_appid
order by primary_key_name;