Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Which cols are part of the primary key?
Rob F schrieb:
> 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;
Thanks too!
Volker
Received on Wed Mar 22 2006 - 10:58:56 CST