Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to get the index name of the primary key ?
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