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: describe table

Re: describe table

From: Andrew Allen <andrew.allen_at_sppaammkiller.handleman.com>
Date: Wed, 05 Mar 2003 19:33:27 GMT
Message-ID: <3E664400.4090702@sppaammkiller.handleman.com>


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.constraint_name = 'MYTABLE_PK'

    AND c.table_name = 'MYTABLE'
  ORDER
     BY l.position;

--
AjA
Received on Wed Mar 05 2003 - 13:33:27 CST

Original text of this message

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