# Jdbc\_static prepared statement error

**URL:** <https://discuss.elastic.co/t/jdbc-static-prepared-statement-error/277507>\
**Category:** Logstash\
**Created:** [July 1, 2021, 3:37am UTC](https://discuss.elastic.co/t/jdbc-static-prepared-statement-error/277507 "2021-07-01T03:37:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![metalshanked](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/metalshanked/32/87159_2.png) [@metalshanked](https://discuss.elastic.co/u/metalshanked)\
**Post date:** [July 1, 2021, 3:37am UTC](https://discuss.elastic.co/t/jdbc-static-prepared-statement-error/277507/1 "2021-07-01T03:37:51Z")

</div>

Hello,

I have the below jdbc\_static lookup statement but it seems to fail with the error:-  
exception=\>#\<Sequel::Error: Mismatched number of placeholders (2) and placeholder arguments (1) when using placeholder string\>, :backt

```auto
{
            query => "SELECT b FROM local_table WHERE a = ? OR a = ?"
            prepared_parameters => ["[source][ip]","[destination][ip]"]
            target => "result_array"
            default_hash => {
                "b" => ""
}

```

Any advice or workaround ?

Thanks in advance!

---

<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:** [July 29, 2021, 3:38am UTC](https://discuss.elastic.co/t/jdbc-static-prepared-statement-error/277507/2 "2021-07-29T03:38:46Z")

</div>

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