# Power Table onCellEdited with SQL table

**URL:** <https://forum.inductiveautomation.com/t/power-table-oncelledited-with-sql-table/11122>\
**Category:** Ignition\
**Created:** [January 26, 2016, 5:04pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-with-sql-table/11122 "2016-01-26T17:04:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kstofcho](https://avatars.discourse-cdn.com/v4/letter/k/a9a28c/32.png) [@Kstofcho](https://forum.inductiveautomation.com/u/Kstofcho)\
**Post date:** [January 26, 2016, 5:04pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-with-sql-table/11122/1 "2016-01-26T17:04:51Z")

</div>

I am trying to update a SQL table when edits are made within a power table using the onCellEdited extension function. I cannot get the following code or any attempted modifications to work. selectedID is a custom property that is functioning correctly. I am running 7.8.0. Thank you!

ID = event.source.selectedID  
query = “UPDATE temp\_budget SET line\_item = ? WHERE ID = ?”  
values = [newValue, ID]  
system.db.runPrepUpdate(query, values, “IgnitionDefault”)

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [January 26, 2016, 7:38pm UTC](https://forum.inductiveautomation.com/t/power-table-oncelledited-with-sql-table/11122/2 "2016-01-26T19:38:32Z")

</div>

Try this.

`
ID = self.selectedID
query = "UPDATE temp_budget SET line_item = ? WHERE ID = ?"
values = [newValue, ID]
system.db.runPrepUpdate(query, values, "IgnitionDefault")`
