# How retrieve data from a table using runNamedQuery

**URL:** <https://forum.inductiveautomation.com/t/how-retrieve-data-from-a-table-using-runnamedquery/74980>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 13, 2023, 7:59pm UTC](https://forum.inductiveautomation.com/t/how-retrieve-data-from-a-table-using-runnamedquery/74980 "2023-06-13T19:59:45Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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:** [June 16, 2023, 12:20pm UTC](https://forum.inductiveautomation.com/t/how-retrieve-data-from-a-table-using-runnamedquery/74980/7 "2023-06-16T12:20:00Z")

</div>

> [@mjohnson0238](#):
>
> via an "on change" script of a tag

That is a dangerous place to run database operations. See this and its linked discussions:

> [@Tag value change event](https://forum.inductiveautomation.com/t/tag-value-change-event/74998/4):
>
> This. Events on tags themselves should run in single digit milliseconds or less, due to the likelihood of blocking the system-wide thread pool for tags. That means no database operations nor any network access operations nor any recursive searches in these events. Gateway tag change events in a project have their own (unbounded) queues and their own threads. Put any time-consuming operations there. But do note that only one thread services all the tags for a given event, so there can be mo…

If you must, you will need to change the call syntax to include the NQ project name to comply with that function's gateway scope requirement.

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-retrieve-data-from-a-table-using-runnamedquery/74980)._
