# runQuery Deprecation and Query Stacks

**URL:** <https://forum.inductiveautomation.com/t/runquery-deprecation-and-query-stacks/113667>\
**Category:** Ignition\
**Tags:** ignition83\
**Created:** [January 30, 2026, 6:53pm UTC](https://forum.inductiveautomation.com/t/runquery-deprecation-and-query-stacks/113667 "2026-01-30T18:53:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Shaw](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Ryan\_Shaw](https://forum.inductiveautomation.com/u/Ryan_Shaw)\
**Post date:** [January 30, 2026, 6:53pm UTC](https://forum.inductiveautomation.com/t/runquery-deprecation-and-query-stacks/113667/1 "2026-01-30T18:53:23Z")

</div>

Hi all.

With 8.3 system.db.runQuery has been deprecated, and the suggested replacement is execQuery (which utilizes named queries instead).

I often use runQuery to execute thousands of queries in one pass, such as when importing values from a csv to merge with a database:

```python
query = 'UPDATE ThisTable SET ThisValue = {} WHERE ID = {}'
queries = []
thisValue = [i for i in range(100000)]
for i in range(100000):
   queries.append(query.format(thisValue[i], i))
outQuery = '\n'.join(queries)
system.db.runQuery(outQuery, 'ThisDB')

```

A named query cannot do this and execQuery would take forever executing these one by one.

Is there a proposed new solution for efficiently handling very large DB tasks like in the example above?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 30, 2026, 6:57pm UTC](https://forum.inductiveautomation.com/t/runquery-deprecation-and-query-stacks/113667/2 "2026-01-30T18:57:39Z")

</div>

`runPrepQuery`/`runPrepUpdate` are the non-deprecated alternatives that allow you to run arbitrary queries defined in scripting, rather than ahead of time.

I'll preempt Phil here and note that you're doing something that's non-standard/non-portable that you've been "getting away with" thus far, and any update to your JDBC driver could break.

`runQuery` is intended to, as the name implies, run _queries_, not arbitrary statements. Batching together many independent updates like this is in the realm of undefined behavior.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [January 30, 2026, 6:58pm UTC](https://forum.inductiveautomation.com/t/runquery-deprecation-and-query-stacks/113667/3 "2026-01-30T18:58:41Z")

</div>

Look into your DB's flavor of MERGE commands.

Additionally, your previous method is extremely vulnerable to SQL injection, you should be using [system.db.runPrepUpdate](https://www.docs.inductiveautomation.com/docs/8.3/appendix/scripting-functions/system-db/system-db-execUpdate) (Which still exists in 8.3) and constructing your query like `UPDATE ThisTable SET ThisValue = ? WHERE ID = ?`, and passing your values as a list.

---

<div class="post-metadata">

**Author:** ![Ryan\_Shaw](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Ryan\_Shaw](https://forum.inductiveautomation.com/u/Ryan_Shaw)\
**Post date:** [January 30, 2026, 7:00pm UTC](https://forum.inductiveautomation.com/t/runquery-deprecation-and-query-stacks/113667/4 "2026-01-30T19:00:41Z")

</div>

Hi Paul.

Thank you for the answer. I thought of that (runPrepUpdate) while I was typing this out, but I figured an official answer would leave me more satisfied that this is “the accepted way” and also that it would be a good question/answer to have on the forum for posterity.

I appreciate it!
