Multiple SQL query not working with delimiter on DBeaver

Viewed 12851

I can't execute MySQL statement when using delimiter (default ';'). I mean, when I run query like:

select * from mdw.dim_date dd limit 10;
select * from mdw.dim_order do limit 5;

I've got such error:

SQL Error [1064] [42000]: 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 'select * from mdw.dim_order do limit 5' at line 2

I don't want to execute this per Alt+X (I am using Dbeaver) as I want to put query into pentaho. I need to execute around 50 deletes, so I don't want to divide it on 50 SQL scripts.

I am using MySQL (version: 5.6.36-82.0).

4 Answers

You need to click on "Execute Script" option on DBeaver

enter image description here

If you click the play button, It will show you that error.

If you is using Dbeaver you can select you script and press ALT+X

wrong and correct way below

enter image description here

Problem solved. Don't know what happened, but for now it's OK. I guess that encoding could change (is there anything like encoding in Dbeaver?), I have no idea, however it's working.

there must be no spaces before delimiter keyword (dbeaver bug I think)

Related