Retrieve information about exported foreign keys
e = exportedkeys(dbmeta, 'cata', 'sch')
e = exportedkeys(dbmeta, 'cata', 'sch', 'tab')
e = exportedkeys(dbmeta, 'cata', 'sch') returns foreign exported key information (that is, information about primary keys that are referenced by other tables) for the schema sch, of the catalog cata, for the database whose database metadata object is dbmeta.
e = exportedkeys(dbmeta, 'cata', 'sch', 'tab') returns exported foreign key information for the table tab, in the schema sch, of the catalog cata, for the database whose database metadata object is dbmeta.
Get foreign exported key information for the schema SCOTT for the database metadata object dbmeta.
e = exportedkeys(dbmeta,'orcl','SCOTT') e = Columns 1 through 7 'orcl' 'SCOTT' 'DEPT' 'DEPTNO' 'orcl'... 'SCOTT' 'EMP' Columns 8 through 13 'DEPTNO' '1' 'null' '1' 'FK_DEPTNO'... 'PK_DEPT'
The results show the foreign exported key information.
Catalog containing primary key that is exported
Schema containing primary key that is exported
Table containing primary key that is exported
Column name of primary key that is exported
Catalog that has foreign key
Schema that has foreign key
Table that has foreign key
Foreign key column name, that is the column name that references the primary key in another table
Sequence number within the foreign key
Update rule, that is, what happens to the foreign key when the primary key updates
Delete rule, that is, what happens to the foreign key when the primary key is deleted
Foreign key name
Primary key name that is referenced by foreign key
In the schema SCOTT, only one primary key is exported to (referenced by) another table. DEPTNO, the primary key of the table DEPT, is referenced by the field DEPTNO in the table EMP. The referenced table is DEPT and the referencing table is EMP. In the DEPT table, DEPTNO is an exported key. Reciprocally, the DEPTNO field in the table EMP is an imported key.
For a description of codes for update and delete rules, see the getExportedKeys property on the Oracle® Java® Web site: