# Pass an array into a named query's WHERE ... IN ( , , , ...) statement

**URL:** <https://forum.inductiveautomation.com/t/pass-an-array-into-a-named-querys-where-in-statement/59968>\
**Category:** Ignition\
**Created:** [May 24, 2022, 4:25pm UTC](https://forum.inductiveautomation.com/t/pass-an-array-into-a-named-querys-where-in-statement/59968 "2022-05-24T16:25:26Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 15, 2025, 4:29pm UTC](https://forum.inductiveautomation.com/t/pass-an-array-into-a-named-querys-where-in-statement/59968/10 "2025-04-15T16:29:32Z")

</div>

_Pssssst!_

> [@Taking a Dataset and Inserting it to a SQL temp table](https://forum.inductiveautomation.com/t/taking-a-dataset-and-inserting-it-to-a-sql-temp-table/83852/4):
>
> If you were using a competent database (the following is PostgreSQL), you can pass java arrays as arguments, and unnest() them in a FROM clause. For an example, I created a table in my psql forum playground called phrases, to be used in a join. When queried by itself, you get this dataset: "#NAMES" "prefix","suffix" "#TYPES" "str","I" "#ROWS","4" "Hello","1" "Good Bye","2" "Welcome to","3" "Whoa!","4" To go with that, in a custom property named lookups, I created the following unbound datase…

and

> [@How to pass WHERE IN \[values for int\] to named query as parameter](https://forum.inductiveautomation.com/t/how-to-pass-where-in-values-for-int-to-named-query-as-parameter/85608/7):
>
> Concur. Just say no to QueryString parameters. Besides, you can [pass arrays to "Prep" queries](https://forum.inductiveautomation.com/t/taking-a-dataset-and-inserting-it-to-a-sql-temp-table/83852/4) if you have a competent database and JDBC drivers. In this case, the PostgreSQL syntax for runPrepQuery would look like this: SELECT \* FROM some\_table WHERE some\_column = ANY (?)

---

_[View the full topic](https://forum.inductiveautomation.com/t/pass-an-array-into-a-named-querys-where-in-statement/59968)._
