Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Parameters [Table of Contents] sp_pkeys

Access Service User's Guide DirectConnect for AS/400

[-] Chapter 12 Accessing catalog information with CSPs
[-] sp_fkeys
[-] Usage

Usage

Results

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:

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.

Result set for sp_fkeys

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:

  • 0 means cascade

  • 1 means restrict

  • 2 means set null

  • NULL means not applicable to the target database

DELETE_RULE

smallint

Action to be applied to the foreign key when the SQL operation is delete:

  • 0 means cascade

  • 1 means restrict

  • 2 means set null

  • NULL means not applicable to the target database

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


Parameters [Table of Contents] sp_pkeys