# Jdbc\_static: Getting a sql syntax error I did'nt write

**URL:** <https://discuss.elastic.co/t/jdbc-static-getting-a-sql-syntax-error-i-didnt-write/187844>\
**Category:** Logstash\
**Created:** [June 27, 2019, 1:32pm UTC](https://discuss.elastic.co/t/jdbc-static-getting-a-sql-syntax-error-i-didnt-write/187844 "2019-06-27T13:32:50Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ErikWarming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erikwarming/32/39525_2.png) [@ErikWarming](https://discuss.elastic.co/u/ErikWarming)\
**Post date:** [July 5, 2019, 7:52am UTC](https://discuss.elastic.co/t/jdbc-static-getting-a-sql-syntax-error-i-didnt-write/187844/6 "2019-07-05T07:52:26Z")

</div>

I don't have a solution, but I am getting wiser `SET GLOBAL sql_mode = 'ANSI_QUOTES';` changes the database setup

> From [https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html)  
> [`ANSI_QUOTES`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_ansi_quotes)
> 
> Treat `"` as an identifier quote character (like the ` quote character) and not as a string quote character. You can still use ` to quote identifiers with this mode enabled. With [`ANSI_QUOTES`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_ansi_quotes) enabled, you cannot use double quotation marks to quote literal strings because they are interpreted as identifiers.

As written [here](https://discuss.elastic.co/t/sqlsyntaxerrorexception/102967), the offending piece of sql code is a count number of rows in the table that I am trying to load with jdbc\_static{loaders... When downloading a table, it needs a checksum to know when its complete. That is why logstash-input-jdbc works on this server, but logstash-filter-jdbc\_static don't. logstash-input-jdbc don't need the checksum

I tried to implement the `SET GLOBAL sql_mode = 'ANSI_QUOTES';` into my query statement, but you need to be a superuser to make global database changes.

---

_[View the full topic](https://discuss.elastic.co/t/jdbc-static-getting-a-sql-syntax-error-i-didnt-write/187844)._
