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 identify the primary key in a table?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to identify the primary key in a table?
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    Post subject:
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    Post subject:
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    Post subject: Re: How to identify the primary key in a table?
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    Post subject:
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    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 Could we identify the called modules ... elixir1986 COBOL Programming 5 Fri Jul 14, 2017 1:53 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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