MySQL Forums
Forum List  »  MySQL for Excel

too many "AND" statements in SQL script
Posted by: Cory Waddoups
Date: November 11, 2014 04:07PM

I am currently using MySQL for Excel and it is working great. I can see all the data in the DB and even refresh the database. However, when I edit a field I am getting an error. I clicked options and review the script prior to executing code. The SQL statement is very long with an "AND" statement for every column in the DB. For example. I update a field in Excel and then the Review script reads:
UPDATE "database"
SET "field I want updated = new value"
WHERE 'id'=1
This is where I want the code to stop; however it continues on forever with
AND 'feild1'='1'
AND 'field2'='2'
AND goes on for 60 different "AND" statements.

With all the "AND" statements the DB will not update. I brings up error "Query did not match any rows in the DB, values in the row 2 may have changed; please refresh values from the DB"

If I remove all the "AND" statements the script runs perfectly. I looked through options and cannot find a way to remove the "AND" scripts. Is there a way to remove this?


Options: ReplyQuote

Written By
too many "AND" statements in SQL script
November 11, 2014 04:07PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.