# Jdbc input- count error

**URL:** <https://discuss.elastic.co/t/jdbc-input-count-error/140217>\
**Category:** Logstash\
**Created:** [July 16, 2018, 8:44pm UTC](https://discuss.elastic.co/t/jdbc-input-count-error/140217 "2018-07-16T20:44:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bclipp770](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bclipp770/32/60198_2.png) [@bclipp770](https://discuss.elastic.co/u/bclipp770)\
**Post date:** [July 16, 2018, 8:44pm UTC](https://discuss.elastic.co/t/jdbc-input-count-error/140217/1 "2018-07-16T20:44:58Z")

</div>

I'm pulling data from an advantage db, and I'm having issues with the query being run prior to statement I'm setting.

`[SAP][Advantage SQL Engine]Unexpected token: LIMIT -- Expecting semicolon. -- Location of error in the SQL statement is: 63: SELECT count(*) AS "COUNT" FROM (SELECT * from test) AS "T1" LIMIT 1`  
I'm thinking this maybe because there is no ; at the end of the query. Is there a way to force a ; at the end or even better turn off this count prior to the running of a query?

the same sql works fine with a ; when I test manually.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 16, 2018, 9:39pm UTC](https://discuss.elastic.co/t/jdbc-input-count-error/140217/2 "2018-07-16T21:39:29Z")

</div>

I don't think advantage supports LIMIT 1. It would use "SELECT TOP 1 ...", no?

---

<div class="post-metadata">

**Author:** ![bclipp770](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bclipp770/32/60198_2.png) [@bclipp770](https://discuss.elastic.co/u/bclipp770)\
**Post date:** [July 18, 2018, 1:47pm UTC](https://discuss.elastic.co/t/jdbc-input-count-error/140217/3 "2018-07-18T13:47:16Z")

</div>

When I manually run a query with Limit 1 with JDBC I can get it to work.  
`SELECT count(*) AS "COUNT" FROM (SELECT * from table) AS "T1" LIMIT 1;`  
without the ; give me an error.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 15, 2018, 1:47pm UTC](https://discuss.elastic.co/t/jdbc-input-count-error/140217/4 "2018-08-15T13:47:16Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
