View previous topic :: View next topic
|
Author |
Message |
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
Hi All,
My requirement is to get the primary key and foriegn key info(if any). for a given table. I know this can be done by quering the system catalog tables but need the specific table name from which i can obtain the same. thanks in advance
Thamilzan. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Two queries
on SYSIBM.SYSKEYS and SYSIBM.SYSFOREIGNKEYS will provide You with the requested info
regards
e.s. |
|
Back to top |
|
|
SHAILESH OZA
New User
Joined: 10 Jun 2005 Posts: 21 Location: Mumbai
|
|
|
|
Go to Spufi Choose option 5 platinum. |
|
Back to top |
|
|
vini_srcna
Active User
Joined: 26 May 2005 Posts: 178 Location: Copenhagen, Denmark
|
|
|
|
For Primary Key:
Query SYSIBM.SYSCOLUMNS for that table with KEYSEQ > 0
For Foriegn Key:
Query SYSIBM.SYSFORIEGNKEYS, SYSIBM.SYSRELS , SYSIBM.SYSKEYS |
|
Back to top |
|
|
|