MySql - only update some rows if the table exists - do not want an error thrown

Posted by Pete Oakey on Stack Overflow See other posts from Stack Overflow or by Pete Oakey
Published on 2012-07-06T14:50:35Z Indexed on 2012/07/06 15:15 UTC
Read the original article Hit count: 212

Filed under:
|
|

I want to run an update query.

The query will be run against multiple databases - not every database will have the table.

I don't want the update to be attempted if the table does not exist. I don't want any error to be thrown - I just want the update to be ignored.

Any ideas?

EDIT: just to be clear - the query is executed in an automated deployment - no human interaction possible.

EDIT2: the logic to say whether the update should run or not will need to be in the MySql query itself. This is not being run through a command prompt or batch or managed code.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about if-statement