RE: Keys in Oracle 9i

RE: Keys in Oracle 9i

 

  

Simple query to look at primary keys:

Select CONSTRAINT_NAME
,STATUS
,INDEX_NAME
From DBA_CONTRAINTS
Where OWNER = '<user>'
And TABLE_NAME = '<Table>'
And CONSTRAINT_TYPE = 'P'

To see the details of the underlying index:

Select TABLE_NAME
,COLUMN_NAME
From DBA_IND_COLUMNS
Where OWNER = '<user>'
And INDEX_NAME = '<index name>' --from above
Order By COLUMN_POSITION

Regards

Garnet

-----Original Message-----
From: Gaurav Sawant
[mailto:oracledba-ezmlmshield-x31201656.[Email address protected]
Sent: 01 February 2007 10:15
To: LazyDBA Discussion
Subject: Keys in Oracle 9i

Hi,
I am stuck with a small issue here.
I want to know a table or possibly a query which can retrieve all the
primary keys in the database for a particular user and a particular
table.

Can anybody help me with this???

Thanks and Regards,
Gaurav Sawant,
Technical Consultant,
PeopleSoft SBU,
Larsen & Toubro Infotech Ltd,
Tel No :- 5593 4278

This document is classified as:
( ) L&T Infotech Proprietary & Confidential
( ) L&T Infotech Confidential
(x) L&T Infotech Internal Use Only
( ) General Business Information

"The things we know best are the things we haven't been taught" -
Marquis
de Vauvenargues

______________________________________________________________________


---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



Oracle LazyDBA home page