Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to find primary keys?

Re: How to find primary keys?

From: Elisa Cotrina <ecotrina_at_ts.es>
Date: 1997/04/03
Message-ID: <33435D60.2361@ts.es>#1/1

Tim Spellman wrote:
>
> I would like a list of all the primary key columns in all my tables.
> I'm
> thinking of something simple like
>
> select table_name, column_name from cols where <what is the condition?>;

The table is not cols it is user_cons_constraints. The description is:

OWNER, CONSTRAINT_NAME, TABLE_NAME, COLUMN_NAME and POSITION (if your primary key is make with two or more columns). You can do a join with user_constraints from get only the primarys and not the foreign or the other type of constraints.

        HTH:                         Elisa Received on Thu Apr 03 1997 - 00:00:00 CST

Original text of this message

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