PDA

View Full Version : How to do DROP INDEX in MySQL?


Kent Multer
05-25-08, 01:06 PM
Hi folks --

I've got a custom module in which the client has entered a bunch of data. I need to modify one of the indexes on one of the tables, hopefully without deleting everything and making the client start over. This is a MySQL store, so I looked in the MySQL 4.1 manual. It gives a couple of different syntaxes for a DROP INDEX statement, so I tried both, but neither one worked. In both cases, the error message I got was:

mysql_real_query: Can't DROP 'CheckMgrCustXLoc_l'; check that column/key exists

Does anyone know the correct syntax for this?

Thanks --

Kent Multer
05-25-08, 04:14 PM
"Never mind" ... this turned out to be a flaw in my own code. In case anyone's wondering, this syntax works:


<MvQUERY NAME="Merchant" QUERY="{ 'DROP INDEX ' $ g.Store_Table_Prefix
$ 'CheckMgrCustXLoc_l ON ' $ g.Store_Table_Prefix $ 'CheckMgrCustXLoc;' }">