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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Enquiring PK Columns

Re: Enquiring PK Columns

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 14 Jan 2005 06:46:12 -0800
Message-ID: <1105713972.875245.69510@c13g2000cwb.googlegroups.com>

tncc wrote:
> How can we know which columns of a table is part of the primary key ?
The
> all_constraints view doesnt provide such an info - it just tell
whether a
> table has a pk constraint or not (by the existence of
constraint_type='p').
>
> Thx for any advice.

SQL> desc user_cons_columns

Name                      Null?    Type
------------------------- -------- -------------------
OWNER                     NOT NULL VARCHAR2(30)
CONSTRAINT_NAME           NOT NULL VARCHAR2(30)
TABLE_NAME                NOT NULL VARCHAR2(30)
COLUMN_NAME               VARCHAR2(4000)
POSITION                  NUMBER

Regards
/Rauf Received on Fri Jan 14 2005 - 08:46:12 CST

Original text of this message

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