Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to find primary key of a table using platinum

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
JnanaR

New User


Joined: 20 Jul 2009
Posts: 24
Location: Mumbai

PostPosted: Sat Jun 26, 2010 1:43 pm    Post subject: how to find primary key of a table using platinum
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

Site Director


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

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

Hello,

This should work with or without Platinum. . .

http://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: 24
Location: Mumbai

PostPosted: Sat Jun 26, 2010 4:32 pm    Post subject: Reply to: how to find primary key of a table using platinum
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

Site Director


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

PostPosted: Sat Jun 26, 2010 10:15 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us