IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to find primary key of a table using platinum


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
JnanaR

New User


Joined: 20 Jul 2009
Posts: 23
Location: Mumbai

PostPosted: Sat Jun 26, 2010 1:43 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sat Jun 26, 2010 3:45 pm
Reply with quote

Hello,

This should work with or without Platinum. . .

ibmmainframes.com/viewtopic.php?t=46520

Possibly this will suffice?
Back to top
View user's profile Send private message
JnanaR

New User


Joined: 20 Jul 2009
Posts: 23
Location: Mumbai

PostPosted: Sat Jun 26, 2010 4:32 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Sat Jun 26, 2010 10:15 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts count contained values of several col... DB2 5
No new posts To join 2 tables and to join 3rd tabl... DB2 8
No new posts Create a specific record/file based o... SYNCSORT 8
No new posts Extract ISPF table column headings CLIST & REXX 2
No new posts sort to find out the char which repea... Mainframe Interview Questions 10
Search our Forums:


Back to Top