# Error while executing query for loading lookup data in jdbc static plug-in

**URL:** <https://discuss.elastic.co/t/error-while-executing-query-for-loading-lookup-data-in-jdbc-static-plug-in/177902>\
**Category:** Logstash\
**Created:** [April 22, 2019, 9:10pm UTC](https://discuss.elastic.co/t/error-while-executing-query-for-loading-lookup-data-in-jdbc-static-plug-in/177902 "2019-04-22T21:10:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohitjejurikar](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rohitjejurikar](https://discuss.elastic.co/u/rohitjejurikar)\
**Post date:** [April 22, 2019, 9:10pm UTC](https://discuss.elastic.co/t/error-while-executing-query-for-loading-lookup-data-in-jdbc-static-plug-in/177902/1 "2019-04-22T21:10:49Z")

</div>

I installed jdbc static plug-in but getting following error:

Java::JavaSql::SQLException: Incorrect syntax near 'LIMIT' but my query does not contain LIMIT word. Mine is a simple query like this:

SELECT col1,col2,col3 FROM table where col1 IS NOT NULL and col2 IS NOT NULL and col3='somevalue'

I am trying to get this data from sybase database. I am able execute same query from logstash jdbc input plug-in but not from this one.

here is my configuration:  
jdbc\_static {  
loaders =\> [  
{  
id =\> "remote"  
query =\> "SELECT col1,col2,col3 FROM table where col1 IS NOT NULL and col2 IS NOT NULL and col3='somevalue'"  
local\_table =\> "abc"   
}  
]  
local\_db\_objects =\> [  
{  
name =\> "smd"  
index\_columns =\> ["ticker\_code"]  
columns =\> [  
["col1", "varchar(255)"],  
["col2", "varchar(255)"],  
["col3", "varchar(255)"]  
]  
}  
]  
local\_lookups =\> [  
{  
id =\> "local"  
query =\> "select col1 from smd where col2 = :col2"  
parameters =\> {id =\> "[id1]"}  
target =\> "isin"  
}  
]  
staging\_directory =\> "c:/temp/logstash/import\_data"  
loader\_schedule =\> "\* \*/2 \* \* \*"  
jdbc\_driver\_library =\> "\jconn4.jar"  
jdbc\_driver\_class =\> "Java::com.sybase.jdbc4.jdbc.SybDataSource"  
jdbc\_connection\_string =\> "jdbc:sybase:Tds:/"   
jdbc\_user =\> "user"  
jdbc\_password =\> "password"   
}

What may be the issue?

Thanks in advance..

---

<div class="post-metadata">

**Author:** ![rohitjejurikar](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@rohitjejurikar](https://discuss.elastic.co/u/rohitjejurikar)\
**Post date:** [April 23, 2019, 12:38pm UTC](https://discuss.elastic.co/t/error-while-executing-query-for-loading-lookup-data-in-jdbc-static-plug-in/177902/2 "2019-04-23T12:38:34Z")

</div>

Hi, any inputs please? Thanks

---

<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:** [May 21, 2019, 12:38pm UTC](https://discuss.elastic.co/t/error-while-executing-query-for-loading-lookup-data-in-jdbc-static-plug-in/177902/3 "2019-05-21T12:38:42Z")

</div>

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