Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Primary Key

Re: Primary Key

From: Roman Mirzaitov <rmirzaitov_at_kt.kg>
Date: Tue, 12 Mar 2002 13:58:13 +0500
Message-ID: <a6kfva$et2rm$1@ID-127142.news.dfncis.de>


"Kram" <myoung_at_optushome.com.au> wrote in message news:Qwgj8.35$an4.4277_at_nsw.nnrp.telstra.net...
> How do I find the primary key of a table?
>

Hi,

select c.table_name, cc.column_name, c.constraint_name from user_constraints c, user_cons_columns cc where c.constraint_name=cc.constraint_name and constraint_type='P'
and c.table_name=<TABLE_NAME>

Also you can use ALL_* or DBA_* table and add OWNER condition.

Regards,

--
Roman Mirzaitov
Brainbench MVP for Oracle Administration
www.brainbench.com
Received on Tue Mar 12 2002 - 02:58:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US