Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Enquiring PK Columns
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