![]() | ![]() |
Home |
|
|
Access Service User's Guide DirectConnect for AS/400 |
|
| Chapter 12 Accessing catalog information with CSPs |
|
| sp_fkeys |
|
| Usage |
This CSP is only supported by OS/400 version 3.1 or higher.
This function corresponds to the ODBC function SQLForeignKeys.
Information is based on the SYSCST, SYSKEYCST, and SYSREFCST system catalog tables.
For information about creating a foreign key, see the appropriate IBM AS/400 DB2/400 SQL Reference manual.
sp_fkeys returns a row for each column that is part of the foreign key or primary key in a primary key/foreign key relationship.
Results are ordered by the following columns:
PKTABLE_OWNER
PKTABLE_NAME
KEY_SEQ
The lengths for varchar columns shown in the result set tables are maximums; the actual lengths depend on the target database.
The following table shows the result set.
Column | Datatype | Description |
PKTABLE_QUALIFIER | varchar(128) | NULL |
PKTABLE_OWNER | varchar(128) | Name of the collection |
PKTABLE_NAME | varchar(128) NOT NULL | Primary key table name |
PKCOLUMN_NAME | varchar(128) NOT NULL | Primary key column name |
FKTABLE_QUALIFIER | varchar(128) | NULL |
FKTABLE_OWNER | varchar(128) | Name of the collection |
FKTABLE_NAME | varchar(128) NOT NULL | Foreign key table name |
FKCOLUMN_NAME | varchar(128) NOT NULL | Foreign key column name |
KEY_SEQ | smallint NOT NULL | Column sequence number in key (starting with 1) |
UPDATE_RULE | smallint | Action to be applied to the foreign key when the SQL operation is update:
|
DELETE_RULE | smallint | Action to be applied to the foreign key when the SQL operation is delete:
|
FK_NAME | varchar(128) | Foreign key identifier; NULL if not applicable to the target database |
PK_NAME | varchar(128) | Primary key identifier; NULL if not applicable to the target database |
|
|