Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 17th, 2004, 10:26 PM
weebeng weebeng is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 76 weebeng User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 22 sec
Reputation Power: 6
show primary key

Hi, I'm using the oracle db. Let said I have the table ac_cardholder. What is the sql command to get know the primary key?
Thank you!
Quote:
SQL> desc ac_cardholder;
Name Null? Type
------------------------ ----------- --------------
ACCH_CARDNO NOT NULL VARCHAR2(10)
ACCH_ICNO VARCHAR2(12)
ACCH_ID NOT NULL VARCHAR2(16)
ACCH_NAME VARCHAR2(60)

Reply With Quote
  #2  
Old January 18th, 2004, 11:40 AM
victorpendleton victorpendleton is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2003
Location: No es importante
Posts: 2,065 victorpendleton User rank is Private First Class (20 - 50 Reputation Level)victorpendleton User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 44 m 30 sec
Reputation Power: 8
You will need to look in the ALL_CONSTRAINTS table where the tablename = 'ac_cardholder'
__________________
El éxito consiste en una serie de pequeñas victorias día a día

MySQL, MS SQL, MS ACCESS, Oracle Database Manager - http://victorpendleton.net/products/psdviewer.html

Reply With Quote
  #3  
Old January 19th, 2004, 08:08 AM
Dan Drillich Dan Drillich is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 68 Dan Drillich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
As victorpendleton says, you should query the ALL_CONSTRAINTS view:

select * from ALL_CONSTRAINTS
where CONSTRAINT_TYPE = 'P' and
TABLE_NAME = 'AC_CARDHOLDER'

Good Day,
Dan

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > show primary key


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway