Jeff
Jeff

Reputation: 8431

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?

Upvotes: 3

Views: 2905

Answers (2)

Mohammed Deifallah
Mohammed Deifallah

Reputation: 1330

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

Upvotes: 3

Ezenhis
Ezenhis

Reputation: 1007

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 ;

Upvotes: 1

Related Questions