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

How to identify the primary key in a table?


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

New User


Joined: 17 Apr 2006
Posts: 7
Location: Kansas City

PostPosted: Tue Jul 25, 2006 12:03 pm
Reply with quote

Hi Friendz,
This is reagrding DB2. I know the table name is X. But i don't know what is the primary key defined in this table : X. Could you please let me know, if you know how to find this?


Thanks & Regards
CSR
Back to top
View user's profile Send private message
anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Tue Jul 25, 2006 12:40 pm
Reply with quote

You can query the catalog tables for this-

Try out this query:

SELECT NAME,UNIQUERULE from SYSIBM.SYSINDEXSES
where TBNAME= 'your table name' and UNIQUERULE = 'P';
Back to top
View user's profile Send private message
neelesht

New User


Joined: 24 Jul 2006
Posts: 99
Location: Los Angeles

PostPosted: Fri Jul 28, 2006 12:37 pm
Reply with quote

Hi Anamika,

what does UNIQUERULE = 'P' mean here ?

Thanks.
Back to top
View user's profile Send private message
chandu_605k

New User


Joined: 17 Apr 2006
Posts: 7
Location: Kansas City

PostPosted: Fri Jul 28, 2006 12:44 pm
Reply with quote

Hi Anamika,
Thanks for sending a quick reply. Its working. Thanks Once again.


Hi Neel(Simply),
'P' means Primary key.
Please correct me if i am wrong.

Thanks & Regards
CSR
Back to top
View user's profile Send private message
neelesht

New User


Joined: 24 Jul 2006
Posts: 99
Location: Los Angeles

PostPosted: Fri Jul 28, 2006 12:46 pm
Reply with quote

Thanks CSR.......so sorry for such a silly qns......

Thanks Anamika.

Thanks.
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 Identify and write records containing... SYNCSORT 11
No new posts Identify Number of Multivolume Dataset All Other Mainframe Topics 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
Search our Forums:


Back to Top