简体   繁体   中英

How to run multiple queries in row safely?

I have the below queries and i can run them one by one successfully,

Delete from eventor.user_role ;
Delete FROM eventor.role ;
delete from eventor.user ;

but when i run all of them together, it complains with the error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Delete FROM eventor.role ;

This is a surprise for me since, i can run the

 Delete FROM eventor.role ;

successfully, and i have terminated all the queries using ; .

So, why am i getting this, and how can i fix it?

According to http://www.aquafold.com/support_faq#commands :

Q: Scripts with multiple statements return errors, while each statement can be executed individually without errors.

Example:

select * from t1 select * from t2 select * from t3

This script returns errors.

Aqua Data Studio uses “go” or “/” symbols as line separators between statements.
Here is a corrected example of the same script:

 select * from t1 / select * from t2 / select * from t3 

or

 select * from t1 go select * from t2 go select * from t3 go 

Try using go or / instead of ;

  • From File , choose Options , then General
  • Check **';' Statement separator **';' Statement separator

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM