Re: how to "drop index if exists"

2007-12-05 Thread Baron Schwartz
On Dec 5, 2007 7:03 AM, Adam Lipscombe <[EMAIL PROTECTED]> wrote: > Sorry I got carried away in my former response. > > When I tried this, > ALTER IGNORE TABLE tbl_name DROP INDEX seems to fail if the index does not > exist. Right. ALTER IGNORE means that rows that violate unique indexes won't b

Re: how to "drop index if exists"

2007-12-05 Thread Adam Lipscombe
Sorry I got carried away in my former response. When I tried this, ALTER IGNORE TABLE tbl_name DROP INDEX seems to fail if the index does not exist. The DROP INDEX statement is part of a larger script, what I want is for the script to conue to execute if this index does not exist. e.g. ALTE

Re: how to "drop index if exists"

2007-12-05 Thread Adam Lipscombe
Fantastic, thanks very much! Adam Rob Wultsch wrote: On Nov 29, 2007 4:34 AM, Adam Lipscombe <[EMAIL PROTECTED]> wrote: Folks How can one conditionally drop an index in MySQL? Googling shows that the "drop index" does not support an "if exists" qualifier - apparently a bug has been raised

Re: how to "drop index if exists"

2007-12-03 Thread Rob Wultsch
ame,'` > DROP INDEX `',ndxName,'`'); > SET @SQLStmt = SQLStatement; > PREPARE s FROM @SQLStmt; > EXECUTE s; > DEALLOCATE PREPARE s; > END IF; > > END $$ > > DELIMITER ; > > Give it a try !!! > > > -

RE: how to "drop index if exists"

2007-12-03 Thread Rolando Edwards
SET @SQLStmt = SQLStatement; PREPARE s FROM @SQLStmt; EXECUTE s; DEALLOCATE PREPARE s; END IF; END $$ DELIMITER ; Give it a try !!! -Original Message- From: Rob Wultsch [mailto:[EMAIL PROTECTED] Sent: Monday, December 03, 2007 12:51 PM To: Adam Lipsco

Re: how to "drop index if exists"

2007-12-03 Thread Rob Wultsch
On Nov 29, 2007 4:34 AM, Adam Lipscombe <[EMAIL PROTECTED]> wrote: > Folks > > > How can one conditionally drop an index in MySQL? > > Googling shows that the "drop index" does not support an "if exists" > qualifier - apparently a bug > has been raised but as far as I know its not fixed yet. > > D

how to "drop index if exists"

2007-11-29 Thread Adam Lipscombe
Folks How can one conditionally drop an index in MySQL? Googling shows that the "drop index" does not support an "if exists" qualifier - apparently a bug has been raised but as far as I know its not fixed yet. Does anyone know of a work-around? TIA - Adam -- MySQL General Mailing List Fo

Re: Drop Index if Exists

2006-09-01 Thread Adam Lipscombe
Thanks What I am getting at is: does the "IF EXISTS" qualifier work in this context? I have an index that is present in some DB's but not in others. I want to run a generic script to upgrade them all. I don't want the script to stop if the index is not present. Thanks - Adam Visolve DB TEA

Re: Drop Index if Exists

2006-09-01 Thread Visolve DB TEAM
Hello Adam,This is the exact syntax to drop the index.DROP INDEX index_name ON tbl_nameThanksVisolve DB Team . - Original Message - From: "Adam Lipscombe" <[EMAIL PROTECTED]> Cc: Sent: Friday, September 01, 2006 3:28 PM Subject: Drop Index if Exists Folks, Does this

Drop Index if Exists

2006-09-01 Thread Adam Lipscombe
Folks, Does this work in MYSQL 5? I tried "DROP INDEX [NAME] IF EXISTS;" and got an error "check your syntax". Thanks - Adam -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]