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: finding a table's primary key

Re: finding a table's primary key

From: James Petts <jpetts_at_celltech.co.uk>
Date: Tue, 02 Mar 1999 13:10:21 GMT
Message-ID: <36dbe32f.424279061@firewall.celltech>


On Tue, 02 Mar 1999 11:38:37 GMT, jerwynn_at_buyasia.com wrote:

>Is there an SQL or PL/SQL command to query the primary key of a table?
>
>If not, where (in which tables) can I find information
>about the primary keys of tables?

select c.table_name TABLE_NAME, cc.column_name COLUMN_NAME, substr('('||cc.position||')',1,8) POSITION from dba_cons_columns cc, dba_constraints c where c.constraint_name=cc.constraint_name and c.constraint_type='P' Received on Tue Mar 02 1999 - 07:10:21 CST

Original text of this message

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