# \[IGN-15572\]system.db.runNamedQuery() broken in 8.3?

**URL:** <https://forum.inductiveautomation.com/t/ign-15572-system-db-runnamedquery-broken-in-8-3/114130>\
**Category:** Ignition\
**Tags:** ignition83\
**Created:** [February 23, 2026, 10:49pm UTC](https://forum.inductiveautomation.com/t/ign-15572-system-db-runnamedquery-broken-in-8-3/114130 "2026-02-23T22:49:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [February 23, 2026, 10:49pm UTC](https://forum.inductiveautomation.com/t/ign-15572-system-db-runnamedquery-broken-in-8-3/114130/1 "2026-02-23T22:49:56Z")

</div>

When I briefly updated to 8.3, one of the first things I noticed was that `system.db.runNamedQuery()` wasn’t just deprecated, but seemed to be broken. I thought that what I had seen was that the Gateway-scoped version of it (the one with project parameter) was throwing errors. Is that accurate? And what is the recommended approach for smooth migration? I can’t just switch to 8.3 and then start changing the hundreds of instances that exist, nor can I change them before making the switch or it will break our current system.

I understand the need to deprecate, given the confusing nature of the scope issue. Since many of my library scripts are invoked from both Gateway and Project scope, I usually would include the project name, since that has worked for both scopes. But unless I’m missing something, the word “deprecated” seems very misleading. That usually means it still works, but there’s a new, better way.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 23, 2026, 11:00pm UTC](https://forum.inductiveautomation.com/t/ign-15572-system-db-runnamedquery-broken-in-8-3/114130/2 "2026-02-23T23:00:17Z")

</div>

I'm not finding anything about `runNamedQuery` being broken.

Have you tried it? Got a link to a post about it?

---

<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:** [February 23, 2026, 11:01pm UTC](https://forum.inductiveautomation.com/t/ign-15572-system-db-runnamedquery-broken-in-8-3/114130/3 "2026-02-23T23:01:14Z")

</div>

It is definitely not expected that `runNamedQuery` doesn't work on the gateway scope. The exact nature of any errors you were encountering would be very helpful.

The intended nature of the deprecation is exactly what you expect: the function is _discouraged_ from use by a more modern alternative that fixes the underlying issue, but existing code absolutely should still work.

The two functions call exactly the same code path:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/d/ad66089491a2fff8848bbabd995342f94c0382b1.png)

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [February 23, 2026, 11:07pm UTC](https://forum.inductiveautomation.com/t/ign-15572-system-db-runnamedquery-broken-in-8-3/114130/4 "2026-02-23T23:07:27Z")

</div>

Hm, I’ll have to try setting up a separate instance of 8.3 to see what exactly the error was. We were moving to a new server, so I thought I’d take that opportunity to make the upgrade, but given those errors (whatever the cause) and the fact that our users didn’t get imported, I decided to switch back to 8.1. But we still have that old server I should be able to test with…

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [February 24, 2026, 7:06pm UTC](https://forum.inductiveautomation.com/t/ign-15572-system-db-runnamedquery-broken-in-8-3/114130/5 "2026-02-24T19:06:24Z")

</div>

It turns out the issue is not with the optional `project` parameter, but with the optional `parameters` parameter. In 8.1, the default is `None`, and you can explicitly pass that with no problem:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/ee16e890757e9b00130127001766e74ba9b3bd4c.png)

But in 8.3, the default is `{}` and it throws an error if you pass `None` :

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/a/9a13e5bca075f2b003e9268b388009e25b6254e9.png)

---

<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:** [February 24, 2026, 7:46pm UTC](https://forum.inductiveautomation.com/t/ign-15572-system-db-runnamedquery-broken-in-8-3/114130/6 "2026-02-24T19:46:29Z")

</div>

Ah, that's an interesting edge case. If it worked in 8.1, we can certainly make it work in 8.3; just an unfortunate consequence of the internal refactoring. Thanks for coming back with details.

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [February 24, 2026, 8:00pm UTC](https://forum.inductiveautomation.com/t/ign-15572-system-db-runnamedquery-broken-in-8-3/114130/7 "2026-02-24T20:00:46Z")

</div>

The reason it was an issue for me is because of a workaround I was using to address the need to run queries from the script console, where the optional project name was problematic. I created a wrapper function that checked whether it should or should not include that parameter:

```python
def runNamedQuery(project, path, params=None):
	if Globals.get('ScriptConsole'):
		return system.db.runNamedQuery(path, params)
	return system.db.runNamedQuery(project, path, params)

```

It wouldn’t surprise me if others have done something similar. Fortunately all I need to do is change `None` to `{}`, but it took me a while to figure that out, so if anyone else can be spared the hassle, I’m sure it’s worth fixing.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [February 24, 2026, 8:37pm UTC](https://forum.inductiveautomation.com/t/ign-15572-system-db-runnamedquery-broken-in-8-3/114130/8 "2026-02-24T20:37:18Z")

</div>

Related [Named query cannot be found in project resource - #8 by lrose](https://forum.inductiveautomation.com/t/named-query-cannot-be-found-in-project-resource/58575/8)

I check the ApplicationScope directly as in here [Which scope is my code running in? - #2 by Kevin.Herron](https://forum.inductiveautomation.com/t/which-scope-is-my-code-running-in/15540/2)
