# Saving Vision Table Component Changes Into SQL Table

**URL:** <https://forum.inductiveautomation.com/t/saving-vision-table-component-changes-into-sql-table/105018>\
**Category:** Ignition\
**Tags:** database, vision, scripting\
**Created:** [April 11, 2025, 8:39pm UTC](https://forum.inductiveautomation.com/t/saving-vision-table-component-changes-into-sql-table/105018 "2025-04-11T20:39:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warren\_McDonald](https://avatars.discourse-cdn.com/v4/letter/w/91b2a8/32.png) [@Warren\_McDonald](https://forum.inductiveautomation.com/u/Warren_McDonald)\
**Post date:** [April 11, 2025, 8:39pm UTC](https://forum.inductiveautomation.com/t/saving-vision-table-component-changes-into-sql-table/105018/1 "2025-04-11T20:39:29Z")

</div>

I have a vision component table on my screen:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/9/69f8028c28acd4273b081f528cc57b4cef7ebe93.png)

This component is directly linked to MySQL table:

SELECT \* FROM userprocesses  
WHERE processName = '{[default]Internal/ActiveProcessRecipe.value}'  
ORDER BY length(layerNumber), layerNumber ASC

I can add and delete rows out of this table, which is directly linked to SQL through a NamedQuery UPDATE on button activation. Once the addition or subtraction of the row, I can click my LOAD button and it performs the above script through a manual poll.

My problem is in regards to all the potential data that is going to be entered into this Ignition table. How can I monitor this, package the new data, and UPDATE MySQL?

This particular example shows 21 layers, but a process is dynamic and may include hundreds of layers. The user may be updating 1 row at a time, or changing them in batches, 3 columns at once, etc.

Can someone point me in the right direction? I'm thinking either a .db.runPrepUpdate or PrepQuery is my command, but I need a way to filter out the edited data, OR a way to examine all the data in the table and just send it as one bulk batch?

Any help is appreciated!

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [May 24, 2025, 4:25am UTC](https://forum.inductiveautomation.com/t/saving-vision-table-component-changes-into-sql-table/105018/2 "2025-05-24T04:25:10Z")

</div>

...so this going to update the database from something like a save button?

It probably doesn't matter if the all of the data has changed or not. Just initiate a transaction, and update all the displayed rows on save. If there is the possibility of new records being added, the `runPrepUpdate` returns the number of rows affected, so if it returns 0 on the update command, simply run an insert command to add the new record. If the update is going to have a noticeable run time due to hundreds of rows, wrap it in a function and call it asynchronously. Perhaps include some sort of status indicator in the gui, so the user knows when the update has completed.
