If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Index exists ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-19-05, 13:58
Hockeyfan Hockeyfan is offline
Registered User
 
Join Date: Dec 2005
Posts: 12
Index exists ?

Is there a select statement to determine if an index exists by a particular name?
I know I can check columns by doing:

Select * from Information_Schema.COLUMNS where COLUMN_NAME='fieldname'


but I'm not sure how to do the same for checking for an index by name.
Reply With Quote
  #2 (permalink)  
Old 12-20-05, 11:11
ranbla ranbla is offline
Registered User
 
Join Date: Aug 2004
Location: San Antonio, TX
Posts: 84
No there isn't. In reference to your other thread asking the same question regarding an existance check for a table, there isn't one for that either. Tables and indexes are part of your database design. Checking to see if they exist doesn't make any sense.
Reply With Quote
  #3 (permalink)  
Old 12-20-05, 11:18
Hockeyfan Hockeyfan is offline
Registered User
 
Join Date: Dec 2005
Posts: 12
Well, I guess that I'm the only one in the world that has ever wanted to do this. Pardon me for not making any sense.

I guess the existence of these forums doesn't make any sense either if you're not allowed to ask a question where one self appointed expert decides that if he doesn't want to do something, then no one else should want to either.

Had it occurred to you that if you're running an application, the application doesn't know the layout of databases on the server, and that it might need to query them to tell what's there, so that it knows if it needs to create something in order to do it's job?

And I don't believe, with all due respect, that it's reasonable to just put in the commands to create a particular database, and then trap for a failure.

Other database systems provide better functionality.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On