# Mystery Update of Table in mySQL

**URL:** <https://forum.inductiveautomation.com/t/mystery-update-of-table-in-mysql/14570>\
**Category:** Ignition\
**Created:** [June 20, 2017, 8:55pm UTC](https://forum.inductiveautomation.com/t/mystery-update-of-table-in-mysql/14570 "2017-06-20T20:55:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeftHandBrewing](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@LeftHandBrewing](https://forum.inductiveautomation.com/u/LeftHandBrewing)\
**Post date:** [June 20, 2017, 8:55pm UTC](https://forum.inductiveautomation.com/t/mystery-update-of-table-in-mysql/14570/1 "2017-06-20T20:55:41Z")

</div>

I am trying to figure out how my predecessor set something up and I am hoping someone here can point me in the right direction…

We are collecting data about a particular batch into many separate data tables in mySQL using transaction groups in Ignition triggered by an event in the PLC. All this makes sense and it is easy to see what is going on. However all this data is then being pushed into a single master table that we use for displaying all the batch data. I know there is a script running somewhere to do this but I can not find it in Ignition (or I am just not looking in the right place). Suggestions on how this might be working or where to look?

Thanks

---

<div class="post-metadata">

**Author:** ![zackscriven](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zackscriven/32/7213_2.png) [@zackscriven](https://forum.inductiveautomation.com/u/zackscriven)\
**Post date:** [June 20, 2017, 9:40pm UTC](https://forum.inductiveautomation.com/t/mystery-update-of-table-in-mysql/14570/2 "2017-06-20T21:40:21Z")

</div>

It could be a stored procedure that runs in the database to copy newly added rows to another table.

The single table could actually be a view. I would start on this table and work backwards.

You could see if adding a row manually to the mysql table makes it show up in the master table, or if it’s only occurring when Ignition adds the rows.

You could also look at gateway timer scripts to see if there is anything there.

It’s hard to tell without some good beer. 😋

---

<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 21, 2017, 11:41am UTC](https://forum.inductiveautomation.com/t/mystery-update-of-table-in-mysql/14570/3 "2017-06-21T11:41:15Z")

</div>

Look in the MySQL database for any triggers defined on the tables specified in your transaction groups. Database triggers are arbitrary stored procedures that run (in the database) when data is added or modified in a table.

---

<div class="post-metadata">

**Author:** ![LeftHandBrewing](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@LeftHandBrewing](https://forum.inductiveautomation.com/u/LeftHandBrewing)\
**Post date:** [June 21, 2017, 2:33pm UTC](https://forum.inductiveautomation.com/t/mystery-update-of-table-in-mysql/14570/4 "2017-06-21T14:33:32Z")

</div>

Thanks for the feedback. I will have look at manually adding data to the other tables

I checked the gateway scripts, there are several but none that have anything to do with this.  
I also looked at the SQL table triggers, I don’t see any when I click on the trigger heading for each table.

Drinking beer has not helped me figure this out yet… I will try and drink more and see if my luck improves.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [June 21, 2017, 4:20pm UTC](https://forum.inductiveautomation.com/t/mystery-update-of-table-in-mysql/14570/5 "2017-06-21T16:20:36Z")

</div>

Could the database script be in a different project than the one you are looking at on the same gateway?

---

<div class="post-metadata">

**Author:** ![LeftHandBrewing](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@LeftHandBrewing](https://forum.inductiveautomation.com/u/LeftHandBrewing)\
**Post date:** [June 21, 2017, 6:37pm UTC](https://forum.inductiveautomation.com/t/mystery-update-of-table-in-mysql/14570/6 "2017-06-21T18:37:31Z")

</div>

Found it - it was a in the Transaction Group - it was right in front of me but I did not know how it worked…

It is being run with a Group Tag in the Triggered Expression Items with an embedded SQL query

Appreciate all the feedback, I got to learn something new and I don’t think I broke anything in the process

---

<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 21, 2017, 7:52pm UTC](https://forum.inductiveautomation.com/t/mystery-update-of-table-in-mysql/14570/7 "2017-06-21T19:52:28Z")

</div>

> [@LeftHandBrewing](#):
>
> Found it

How much beer did it take? (-:
