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: <mboizeau_at_free.fr>
Date: 14 Jan 2005 08:00:22 -0800
Message-ID: <1105718422.545966.49820@c13g2000cwb.googlegroups.com>

You need to make a join between the too views ALL_CONSTRAINTS and ALL_CONS_COLUMNS The exact sql syntax you need is here :
http://oraclevsmicrosoft.blogspot.com/2005/01/oracle-data-dictionary.html

Hope this helps

OracleVsMicrosoft

http://OracleVsMicrosoft.blogspot.com

HansF wrote:
> On Fri, 14 Jan 2005 21:37:05 +0800, 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.
>
> The ALL_CONSTRAINTS view is only one of many views to help you. You
might
> want to become familiar with the Oracle Reference Manual to identify
the
> remaining views, as well as the initialization parameters and a host
of
> other goodies.
>
> Note: it's not the same as the SQL Reference which you should
already
> be reading.
>
> What you want is in ALL_CONS_COLUMNS
>
> /Hans
Received on Fri Jan 14 2005 - 10:00:22 CST

Original text of this message

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