# Why does this query work in testing, but not when I try to populate a table?

**URL:** <https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [August 1, 2025, 1:01pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249 "2025-08-01T13:01:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 1, 2025, 1:01pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/1 "2025-08-01T13:01:01Z")

</div>

I'm trying to learn how to use SQL in ignition. When I execute this query in a testing environment I get this data

![image](https://us1.discourse-cdn.com/inductiveautomation/optimized/3X/c/9/c901441923d453d9fc6c6023856b1bda670afff5_2_690x48.png)

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

When I try to bind it to a table, I get this error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/89785cb806ccf46d1b58a0530947d66c28f8a6a0.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/c/dcefef30b2ae84d62ca46545ad1a50b793955b23.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/5/a57f94537c49c0c3d676850d82c63d09b8c3e804.png)

Why would it work in testing, but not on a binding?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 1, 2025, 1:23pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/2 "2025-08-01T13:23:16Z")

</div>

On the error popup there is a link to the full error. Can you click that and then copy and paste it properly formatted here? There might be more information in that error that will help.

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 1, 2025, 1:29pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/3 "2025-08-01T13:29:39Z")

</div>

```python
java.lang.Exception: Error running query:
com.inductiveautomation.factorypmi.application.gateway.NQuery@45674957@0ms
On: Popup.Root Container.Table.data
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$QueryExecutor.run(QueryManager.java:311)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Error in named query practice
	at com.inductiveautomation.factorypmi.application.gateway.NQuery.execute(NQuery.java:78)
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$Query.execute(QueryManager.java:668)
	at com.inductiveautomation.factorypmi.application.gateway.QueryManager$QueryExecutor.run(QueryManager.java:308)
	... 1 more

Ignition v8.1.48 (b2025042910)
Java: Azul Systems, Inc. 17.0.14

```

Sure, here it is

---

<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:** [August 1, 2025, 1:31pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/4 "2025-08-01T13:31:00Z")

</div>

Have you saved your project since your last edit to the NQ?

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 1, 2025, 1:35pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/5 "2025-08-01T13:35:33Z")

</div>

yes, I just saved again in case I was mistaken. Still no dice

---

<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:** [August 1, 2025, 1:37pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/6 "2025-08-01T13:37:12Z")

</div>

Is there a corresponding logged error in the gateway?

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 1, 2025, 1:42pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/7 "2025-08-01T13:42:33Z")

</div>

I'm not seeing one, just a bunch of errors from the email notification pipeline I created:

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

I scrolled to where the error would be, and did not see anything other than more of these

---

<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:** [August 1, 2025, 1:43pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/8 "2025-08-01T13:43:44Z")

</div>

Try turning off the noisy logger then running the table query again.

(You are trying to send email through IA's servers, so of course that part doesn't work. 🙄 )

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 1, 2025, 1:46pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/9 "2025-08-01T13:46:49Z")

</div>

Do you mean disabling the pipeline, or something else?

---

<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:** [August 1, 2025, 1:49pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/10 "2025-08-01T13:49:05Z")

</div>

Either disable the pipeline (probably the right thing, since it cannot work with IA's server), or disable the logger. (Hit the gear icon on the logs page, search for that logger, and set it's level to OFF.)

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 1, 2025, 1:51pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/11 "2025-08-01T13:51:40Z")

</div>

I disabled the email pipeline by renaming it. I'm still not seeing an error on the gateway. I have tried several more times

---

<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:** [August 1, 2025, 1:53pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/12 "2025-08-01T13:53:24Z")

</div>

You may need to enable DEBUG logging on named query execution. (I don't know the logger names off the top of my head--search in the logger level controls.)

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 1, 2025, 1:56pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/13 "2025-08-01T13:56:17Z")

</div>

this right?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/780039ec4b6b1439488149f5034aeb2a8f1efc2a.png)

---

<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:** [August 1, 2025, 1:58pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/14 "2025-08-01T13:58:27Z")

</div>

Yep, and/or the one above it.

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 1, 2025, 2:00pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/15 "2025-08-01T14:00:16Z")

</div>

I'm still not getting any error information on the gateway. This is all I'm seeing:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/0/1096a5f2be160f669857e144e1d2911dd04781b0.png)

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 1, 2025, 2:03pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/16 "2025-08-01T14:03:22Z")

</div>

In that error box, there are other errors. Do any of them pertain to this query? Is there anything in the Designer Console?

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 1, 2025, 2:04pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/17 "2025-08-01T14:04:24Z")

</div>

I have the query set to run every 20 seconds on the table so I will see it if it shows up on the gateway. Those are just more instances of the same error

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 1, 2025, 2:08pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/18 "2025-08-01T14:08:14Z")

</div>

Is this named query in the same project that you have the table in? You have saved the named query and saved the project as well, correct?

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [August 1, 2025, 2:12pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/19 "2025-08-01T14:12:24Z")

</div>

Yes, the named query is in the same project. I have saved the project as a whole many times. Is there something I need to do to save the query in particular?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 1, 2025, 2:14pm UTC](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249/20 "2025-08-01T14:14:52Z")

</div>

Not that I'm aware of. Named queries though typically just work.

Do you have the named query open? If so close it, and then save the project.

Did you check the Developer Console, Help -\> Diagnostics -\> Console and see if there is anything more in that window? Maybe clear it and then open your offending window to see if something popups up.

[Next page](https://forum.inductiveautomation.com/t/why-does-this-query-work-in-testing-but-not-when-i-try-to-populate-a-table/109249.md?page=2)
