Installation guide
7. mxODBC Cursor Objects
.foreignkeys(primary_qualifier=None, primary_owner=None,
pimary_table=None, foreign_qualifier=None, foreign_owner=None,
foreign_table=None)
Query the database schema for information on foreign keys. The method has
two modes of operation, depending on which parameter is set:
primary_table
The method returns a list of foreign key columns in other tables that refer
to the primary key column of the given table and the primary key column of
the given table itself.
foreign_table
The method returns a list of foreign key columns in a table that refer to the
primary keys of other tables and the primary key columns of those other
tables.
This is useful to determine the relationships between the tables in a database
schema.
The catalog method generates a result set having the following schema:
Column Name Column Datatype Comment
PKTABLE_CAT VARCHAR(128) Always NULL.
PKTABLE_SCHEMA VARCHAR(128) The name of the schema containing
PKTABLE_NAME.
PKTABLE_NAME VARCHAR(128) not
NULL
Name of the table containing the primary key.
PKCOLUMN_NAME VARCHAR(128) not
NULL
Primary key column name.
FKTABLE_CAT VARCHAR(128) Always NULL.
FKTABLE_SCHEMA VARCHAR(128) The name of the schema containing
FKTABLE_NAME.
FKTABLE_NAME VARCHAR(128) not
NULL
Name of the table containing the foreign key.
FKCOLUMN_NAME VARCHAR(128) not
NULL
Foreign key column name.
ORDINAL_POSITION SMALLINT not NULL The ordinal position of the column in the key,
starting at 1.
UPDATE_RULE SMALLINT Action to be applied to the foreign key when
119