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.

DBeaver reports SQL Error [102] [S0001]: Incorrect syntax near ','. on correct SQL

See original GitHub issue

System information:

  • Operating system (distribution) and version Windows 10 1809 Build 17763.437
  • DBeaver version 6.0.3
  • Java version 1.8.0_191
  • Additional extensions None

Connection specification:

  • Database name and version SQL Server Microsoft SQL Sever 12.00.1400 (Azure)
  • Driver name Microsoft JDBC Driver 7.0 for SQL Server 7.0.0.0
  • Do you use tunnels or proxies (SSH, SOCKS, etc)? No.

Describe the problem you’re observing:

While trying to execute a valid SQL with a table alias, I get the SQL Error [102] [S0001]: Incorrect syntax near ‘,’. error:

Steps to reproduce, if exist:

Simply try to execute a SQL like this: select c.column1, c.column2 from dbo.table c where c.column = 1 and c.colum3 = YVALUE and anotherValue is not null;

This returns the error. The error only occurs if you don’t select the whole line to run the query. If you select it, the query runs normally, proving that there is nothing wrong with the query itself.

This bug started with the release of the 6.0 version.

Include any warning/errors/backtraces from the logs

!ENTRY org.jkiss.dbeaver.model 4 0 2019-04-25 20:54:41.117 !MESSAGE Error executing query !SUBENTRY 1 org.jkiss.dbeaver.model 4 0 2019-04-25 20:54:41.118 !MESSAGE SQL Error [102] [S0001]: Incorrect syntax near ','. !SUBENTRY 2 org.jkiss.dbeaver.model 4 0 2019-04-25 20:54:41.118 !MESSAGE Incorrect syntax near ','. !STACK 0 com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near ','. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:254) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1608) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:859) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:759) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7240) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2869) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:243) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:218) at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:739) at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:338) at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:131) at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:467) at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$0(SQLQueryJob.java:407) at org.jkiss.dbeaver.model.DBUtils.tryExecuteRecover(DBUtils.java:1684) at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:405) at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:849) at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:2720) at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:102) at org.jkiss.dbeaver.model.DBUtils.tryExecuteRecover(DBUtils.java:1684) at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:100) at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:102) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vitordmcommented, Mar 7, 2022

I know this is closed, but, for solve this problem, I had to copy all the script to a “notepad++” and convert all text to ANSI, and then I copy all to DBeaver and it works.

0reactions
estefanionsantoscommented, Oct 6, 2022

I know this is closed, but, for solve this problem, I had to copy all the script to a “notepad++” and convert all text to ANSI, and then I copy all to DBeaver and it works. – cool Vitor, i will test your solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved]Sybase. Device creating. SQL Error [102] [37000]
Hello, To execute scripts DBeaver parses SQL statements using delimiter ";". Sybase (and MS SQL) may use non-standard delimiter "go".
Read more >
Why do I keep getting an incorrect syntax error using SQL ...
You got a syntax error because you did not specify your query using the right syntax. Since you did not include the statement...
Read more >
Incorrect Syntax Near ';' (Microsoft Sql Server Error 102)
This error message occurs if we use GETDATE like function as a parameter to Stored Procedure or Function Statement. or the second error...
Read more >
Incorrect syntax near ')'. SQL query is wrong while running on ...
Incorrect syntax near ')'. SQL query is wrong while running on both DBeaver and on java mapper files? ; looks like you made...
Read more >
how to let dbeaver to highlight sql error for easier ...
In this case, your problem is you have a comma at the end of db4_open, right before the FROM clause. Remove that comma...
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