Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us