Database Toolbox |
Get information about imported foreign keys
Syntax
Description
i = importedkeys(dbmeta, 'cata', 'sch')
returns the foreign imported key information, that is, information about fields that reference primary keys in other tables, in the schema sch
, of the catalog cata
, for the database whose database metadata object is dbmeta
, where dbmeta
was created using dmd
.
i = importedkeys(dbmeta, 'cata', 'sch', 'tab')
returns the foreign imported key information, that is, information about fields in the table tab
, that reference primary keys in other tables, in the schema sch
, of the catalog cata
, for the database whose database metadata object is dbmeta
, where dbmeta
was created using dmd
.
Examples
i = 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 imported key information as described in the following table.
In the schema SCOTT
there is only one foreign imported key. The table EMP
contains a field, DEPTNO
, that references the primary key in the DEPT
table, the DEPTNO
field. EMP
is the referencing table and DEPT
is the referenced table. DEPTNO
is a foreign imported key in the EMP
table. Reciprocally, the DEPTNO
field in the table DEPT
is an exported foreign key, as well as being the primary key.
For a description of the codes for update and delete rules, seehttp://java.sun.com/j2se/1.4.2/docs/api/java/sql/DatabaseMetaData.html
for the getImportedKeys
property.
See Also
crossreference
, dmd
, exportedkeys
, get
, primarykeys
get | indexinfo |
© 1994-2005 The MathWorks, Inc.