Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: describe table
Alistair Thomson wrote:
> Hi
>
> You can use USER_IND_COLUMNS. Use USER_CONSTRAINTS to identify the primary
> key index.
>
> Alistair
>
>
> "Peter Valicek" <Sonny2_at_gmx.de> wrote in message
> news:b454q8$4d8$04$1_at_news.t-online.com...
> Hello,
>
> how can I get the infos from a table abput which field is an index and where
> is the primary key. I'd like to know this to improve my sql queries.
>
> Thanks in forward.
>
or try this
SELECT c.constraint_name,
l.column_name
FROM dba_constraints c,
dba_cons_columns l
WHERE c.owner = l.owner AND c.constraint_name = l.constraint_name AND c.table_name = l.table_name AND c.constraint_type = 'P'
AND c.table_name = 'MYTABLE'
ORDER
BY l.position;
-- AjAReceived on Wed Mar 05 2003 - 13:33:27 CST