# Write to a memory tag from a database update

**URL:** <https://forum.inductiveautomation.com/t/write-to-a-memory-tag-from-a-database-update/17934>\
**Category:** Ignition\
**Created:** [May 6, 2018, 2:07pm UTC](https://forum.inductiveautomation.com/t/write-to-a-memory-tag-from-a-database-update/17934 "2018-05-06T14:07:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [May 6, 2018, 2:07pm UTC](https://forum.inductiveautomation.com/t/write-to-a-memory-tag-from-a-database-update/17934/1 "2018-05-06T14:07:28Z")

</div>

Does anyone know how to write a gateway script on a update from a database to write to a memory tag?

---

<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:** [May 6, 2018, 10:20pm UTC](https://forum.inductiveautomation.com/t/write-to-a-memory-tag-from-a-database-update/17934/2 "2018-05-06T22:20:41Z")

</div>

I’m not sure I understand your question. What’s writing to the memory tag? That can trigger a tag event or a tag change event script, which can then compute some update to your DB.

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [May 6, 2018, 10:35pm UTC](https://forum.inductiveautomation.com/t/write-to-a-memory-tag-from-a-database-update/17934/3 "2018-05-06T22:35:11Z")

</div>

when I insert a new record of data I want to write a value in a certain column to a tag

---

<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:** [May 7, 2018, 12:10am UTC](https://forum.inductiveautomation.com/t/write-to-a-memory-tag-from-a-database-update/17934/4 "2018-05-07T00:10:54Z")

</div>

You’ll have to repeatedly query the database to obtain any new information. Look at [Query tags](https://www.inductiveuniversity.com/video/creating-query-tags) – you should be able to use an event triggered by one of those.
