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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Primary Key

Re: Primary Key

From: Andrew Velichko <andrew_velichko_at_yahoo.com>
Date: Wed, 28 Feb 2001 11:56:46 -0500
Message-ID: <Z8an6.135203$Z2.1822332@nnrp1.uunet.ca>

Hi Peter!

The following select will return what you want: select * from user_cons_columns where constraint_name= (select constraint_name from user_constraints where table_name='YOUR_TABLE' and constraint_type='P');

Actually it will return columns in this constraint. Subquery returns constraint name.

Andrew Velichko
Brainbench MVP for Oracle Developer 2000 http://www.brainbench.com


"Peter Chase" <chasep99_at_excite.ca> wrote in message news:Mj9n6.1967$br1.49775_at_sodalite.nbnet.nb.ca...
> I am using Oracle 8i Personal Edition. Is there an sql statement that I
 can
> use that will return the primary key for a given table.
>
>
Received on Wed Feb 28 2001 - 10:56:46 CST

Original text of this message

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