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: Which cols are part of the primary key?

Re: Which cols are part of the primary key?

From: Rob F <robfegan_at_coracle.fsbusiness.co.uk>
Date: 20 Mar 2006 06:49:38 -0800
Message-ID: <1142866178.782750.254830@g10g2000cwb.googlegroups.com>


Hopefully the following is what you're looking for, it should work with 10g as well I believe ;-
select di.column_name
from dba_ind_columns di,

       dba_constraints dc

where  dc.owner = <table owner>
and    dc.table_name = <table name>
and    dc.constraint_type = 'P'
and    di.owner = dc.owner
and    di.table_name = dc.table_name
and    di.index_name = dc.constraint_name
order by di.column_position;

Regards,
  Rob Received on Mon Mar 20 2006 - 08:49:38 CST

Original text of this message

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