# Refresh or update a query tag

**URL:** <https://forum.inductiveautomation.com/t/refresh-or-update-a-query-tag/78361>\
**Category:** Ignition\
**Created:** [August 24, 2023, 9:25pm UTC](https://forum.inductiveautomation.com/t/refresh-or-update-a-query-tag/78361 "2023-08-24T21:25:40Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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 25, 2023, 1:30pm UTC](https://forum.inductiveautomation.com/t/refresh-or-update-a-query-tag/78361/4 "2023-08-25T13:30:12Z")

</div>

Two issues:

- When running a tag event, the script is outside any normal project scope, and therefore has no default database. The optional parameter to `system.db.runQuery` for the database is **not optional** in this situation.

- Running any kind of database query, unless it **always** executes extremely quickly (single-digit milliseconds), is inappropriate in tag event scripts. Use a gateway tag change script instead (in the project, subscribed to the reference tag, not **on** the reference tag).

{ Failure to follow the fast-execution rule for tag events can crush your entire system. }

---

_[View the full topic](https://forum.inductiveautomation.com/t/refresh-or-update-a-query-tag/78361)._
