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: How to get the index name of the primary key ?

Re: How to get the index name of the primary key ?

From: Rob Medley <medleyrk_at_iafrica.com>
Date: Fri, 27 Nov 1998 23:00:57 +0200
Message-ID: <365F1309.ADEA7F62@iafrica.com>


Hi,

To see if a table has a primary key you can :

select constraint_name from dba_constraints where table_name = '<table_name>' AND constraint_type = 'P'; (table_name must be upper case !)

The index created to enforce this primary key has the same name as the constraint name. To get more info about the index: select * from dba_indexes where index name = whatever;

cheers,
Rob Medley
medleyrk_at_iafrica.com

Bernhard Mandl wrote:

> Hello,
>
> I guess it must be in one of the system tables
>
> 1.) if a table has a primary key defined and
> 2.) if so, what's the index name of the primary key
>
> Does anyone know how to query this info ?
>
> thanks
>
> Bernhard
Received on Fri Nov 27 1998 - 15:00:57 CST

Original text of this message

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