Is there a possibility to execute multiple CREATE TABLE within one mysql query?
1 Answer
No. You must do them in multiple queries.
<incorrect>However, you can wrap the creation queries in a transaction to allow you to roll back the entire operation if something fails.</incorrect>
UPDATE: Ok, as pilcrow points out, each create causes an implicit commit, so you can't use transactions for this. You can, however, wrap the inserts (for a backup restore) in transactions.
2 Comments
pilcrow
No, you cannot ROLLBACK multiple table creation statements — like many DDL statements they cause an implicit commit
Polynomial
@pilcrow - Wasn't aware of that. I'll update to reflect that fact.