Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting indexes from table 1

Status
Not open for further replies.

Zargo

Programmer
Joined
Mar 21, 2005
Messages
109
Hi all,

How can we get (in a SQL statement) all indexes on a table?

IN SQL server we could do this with a stored procedure called sp_helpindex(sp_helpindex tablename) how to do this in Oracle?

TIA
 
Try this

select index_name
from all_indexes
where table_name = (INSERT YOUR TABLE_NAME HERE)
and owner = (INSERT SCHEMA NAME HERE)


Is this what you are looking for?
 
HMM, It sounds good i have tried

select index_name
from all_indexes
where OWNER = "USERA"

But i'm getting an ORA-00904 eror (invalid identifier) on the "USERA" statement. The user exists and there are some tables witch has indexes..

Any idea?

 
Use single quotes, not double quotes:
Code:
select index_name 
from all_indexes 
where OWNER = 'USERA'

Beware of false knowledge; it is more dangerous than ignorance. ~George Bernard Shaw
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: Emu Products Plus
 
Are you using double quotes?

Try using single quotes if you are.
 
Oops indeed...Thanks all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top