DBeaver reports SQL Error [102] [S0001]: Incorrect syntax near ','. on correct SQL
See original GitHub issueSystem 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:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
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.