question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error interpreting sql statements with blank lines

See original GitHub issue

Hello, this topic was treated in this thread: http://dbeaver.jkiss.org/forum/viewtopic.php?f=2&t=669, although I don’t know how to solve it.

This is a silly example (with postgres):

select *

from objeto;

returning this error:

SQL Error [42601]: ERROR: error de sintaxis en o cerca de «from»
  Position: 1

In Window->Preferences->Editors->SQL Editor->SQL Processing, Statement delimiter is set ; but I don’t found anything about don’t use blank lines as statement delimiter too.

Is it possible ignore blank lines as statement delimiter?

It is very useful when writing multiples PL procedures in the same script because I separate some of its code with blank lines to be more readable, and I want to execute only one of this statements (execute as statement not as script).

In Oracle sqlplus/sqldeveloper, the character / is used to specify the end of statement (function, trigger, anonymous block, etc).

Regards.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
serge-ridercommented, Feb 16, 2016

Will be added in the next version

2reactions
serge-ridercommented, Jan 25, 2016

Currently statement execution command (ctrl+enter) threats blank lines as statement delimiter. At the moment there is no workaround for that. Mostly because some databases works that way. Also because it is simply convenient. But you can select your statement (with any number of blank lines/special characters inside) and execute it (ctrl+enter). Also you can execute it as script (alt+x) - in this case only statement delimiter (; by default) will be used as delimiter.

I could add some additional config option (like “Use blank line as statement delimiter”) for SQL processing… WDYT?

Read more comments on GitHub >

github_iconTop Results From Across the Web

DBeaver throws SQL error when query contains empty lines
Re: DBeaver throws SQL error when query contains empty lines​​ Actually it is not a bug. DBeaver has two modes of SQL execution:...
Read more >
ERROR - rest of line ignored — oracle-tech
The default is OFF, which means a blank line is interpreted as the end of the SQL statement. Run this sql*plus command at...
Read more >
SQL Toad/Oracle strange behavior - Stack Overflow
Uncheck the "Treat blank line as statement terminator" option on the Execute/Compile page in Options. You can use Ctrl+Enter to execute code ...
Read more >
How To Allow Blank Lines In Your SQL Statements
This statement has two options to turn ON or OFF blank lines. If blank lines are turned on, then you are allowed to...
Read more >
Debugging SQL syntax errors - Metabase
Reading your SQL error message · Tell you the line or character position? · Include a table or column name? If the table...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found