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 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 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