View previous topic :: View next topic
|
Author |
Message |
JnanaR
New User
Joined: 20 Jul 2009 Posts: 23 Location: Mumbai
|
|
|
|
Hi
If anyone uses platinum for db2 in their org. please let me know how
to find the primary key of a table.Thanks in advance.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
JnanaR
New User
Joined: 20 Jul 2009 Posts: 23 Location: Mumbai
|
|
|
|
Thanks for the link..
I am kinda new to DB2 and the system tables.I was not able to understand how to get the primary key of a table from SYSIBM.SYSINDEXES and SYSIBM.SYSKEYS.It would be helpful if you could elaborate please.Thanks... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you are interested in this kind of information, suggest you become familiar with these. No matter how you "get" the info (spufi, qmf, Platinum, etc) you will still need to know where the data resides to meet your need.
Suggest you speak with your dba as some of these types of queries may already exist and you could use them as a starting point. Also, be aware that sometimes access to the system tables is restricted. . .
You might try this:
Code: |
SELECT A.COLNAME, A.COLSEQ, A.ORDERING, FROM SYSIBM.SYSKEYS A, SYSIBM.SYSINDEXES B WHERE A.IXNAME = B.NAME
AND A.IXCREATOR = B.CREATOR AND A.IXCREATOR = B.TBCREATOR AND B.TBNAME = <TAB NAME> AND B.TBCREATOR = <TAB CREATOR> AND B.UNIQUERULE = āPā; |
from an eariler post in the forum. . . The forum search is yor friend |
|
Back to top |
|
|
|