Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Get the primary key name of a table
On Wed, 16 Mar 2005 16:09:52 +0000, Robert Wehofer wrote:
> Hello there!
>
> Which SELECT statement do I need to execute to get the primary key name of a
> certain table?
>
> Robert
Go to the doc at http://docs.oracle.com or http://tahiti.oracle.com, dive into the version you need - these things can change based on version (although this one doesn't) - and pull up the REFERENCE manual. Take a gander at the ???_CONSTRAINTS and ???_CONS_COLUMNS views (??? is one of USER, ALL, or DBA depending on you privs).
I'll let you figger the actual SELECT based on this. Received on Wed Mar 16 2005 - 10:20:15 CST