0

I am switching from SQLDeveloper to DBeaver in my work with Oracle 10G database, have the Oracle instantclient for the exact version of the database.

I do not make scripts, just a bunch of queries, like select, update. I had a collection of them, each on one or few lines, with semicolon at the end, followed by two dashes and comment. Multiple line statements for visual separation separated with lines of many dashes.

SQLDeveloper treated such a system well, CTRL+Enter executed only that line (or group from last comment or semicolon to the next semicolon), ignored comment after or before. So I copied the whole collection from the one programs main window to the other (SQL Editor). Usage results are weird.

Example in new SQL Editor tab (table names changed, so ignore if I got some reserved words):

select * from FILE_MOVEMENT where MOVEMENT_STATUS != 'MOVED' and LAST_UPDATE > sysdate -10 order by LAST_UPDATE desc;--My comment, explanation
select * from ACTIVITY where ACTIVITY_TYPE = 'GENERATOR' and STATUS = 'CREATED' and STARTED > sysdate -10 order by STARTED desc;--My other comment

The first one executes as expected with CTRL+Enter, line start flashes with single triangle and the Execution log shows only my command until the semicolon. But when cursor placed at second line followed by CTRL+Enter, I get triangles before both lines, all after first lines semicolon until second lines end including both comments gets selected and ORA-00911 pops up. The selected text shows up in Execution log.

If I put an empty line between them, then whole second line gets selected and logged and same error pops up.

What to do to stop such behaviour and make the second line also execute same way as first - without previous and next comment? Is there some language or line end or comment settings in DBeaver I have missed?

uldics
  • 117
  • 1
  • 11
  • HeidiSQL has a similar annoying behavior. Can you first let us know that each query will execute independently, one at a time? – Tim Biegeleisen Jan 21 '16 at 07:40
  • 1
    Try to not place comments after semicolons. Place comments before statements. I don't know how DBeaver behaves with these, but I know of at least one other tool which cannot correctly execute such statements. – peter.hrasko.sk Jan 21 '16 at 08:27
  • First one will give all movements which haven't ended with correct status and the times with last status change. So I can see whether there are movements I need to do something about. Second one is actually same but for other activity type, where status created should have been changed to finished. So I can take a look on those. – uldics Jan 21 '16 at 10:05

2 Answers2

2

Dbeaver uses Ctrl+Enter shortcut for executing single statement, for executing multiple statements you should use Alt+X.

enter image description here

Ahmed Soliman
  • 43
  • 1
  • 11
-1

Few last versions of DBeaver act acceptable. Even though the previous lines comment comes up in the statement to be executed, it acts as expected. The correct statement is executed, log shows comment as start of query, but it is ignored. That I can live with.

uldics
  • 117
  • 1
  • 11