Database Toolbox | ![]() ![]() |
Get information about exported foreign keys
Syntax
e = exportedkeys(dbmeta, 'cata', 'sch') e = exportedkeys(dbmeta, 'cata', 'sch', 'tab')
Description
e = exportedkeys(dbmeta, 'cata', 'sch')
returns the foreign exported key information (that is, information about primary keys that are referenced by 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
.
e = exportedkeys(dbmeta, 'cata', 'sch', 'tab')
returns the exported foreign key information (that is, information about the primary key which is referenced by other tables), in the table tab
, in the schema sch
, of the catalog cata
, for the database whose database metadata object is dbmeta
, where dbmeta
was created using dmd
.
Examples
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'
dbmeta
is the database metadata objectcata
field is empty because this database does not include catalogsSCOTT
is the schema, sch
The results show the foreign exported key information.
In the schema SCOTT
, there is only one primary key that is exported to (referenced by) another table. The table DEPT
contains a field DEPTNO
, its primary key, that 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 the codes for update and delete rules, see
http://java.sun.com/products/jdk/1.2/docs/api/java/sql/package-summary.html for the DatabaseMetaData
object property getExporetedKeys
.
See Also
crossreference
, dmd
, get
, importedkeys
, primarykeys
![]() | exec | fetch | ![]() |