User`s guide

crossreference
7-31
crossreference
Retrieve information about primary and foreign keys
Syntax
f = crossreference(dbmeta, 'pcata', 'psch', 'ptab', 'fcata', 'fsch',
'ftab')
Description
f = crossreference(dbmeta, 'pcata', 'psch', 'ptab', 'fcata', 'fsch',
'ftab') returns information about the relationship between foreign keys and primary
keys for the database whose database metadata object is dbmeta. The primary key
information is for the table ptab in the primary schema psch. The primary catalog is
pcata. The foreign key information is for the foreign table ftab in the foreign schema
fsch. The foreign catalog is fcata.
Examples
Run crossreference to get primary and foreign key information. The database
metadata object is dbmeta, the primary and foreign catalog is orcl, the primary and
foreign schema is SCOTT, the table that contains the referenced primary key is DEPT, and
the table that contains the foreign key is EMP.
f = crossreference(dbmeta,'orcl','SCOTT','DEPT',...
'orcl','SCOTT','EMP')
f = 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 following primary and foreign key information.