# Alarm changes not reflected in SQL tag

**URL:** <https://forum.inductiveautomation.com/t/alarm-changes-not-reflected-in-sql-tag/5507>\
**Category:** Ignition\
**Created:** [November 30, 2012, 2:45pm UTC](https://forum.inductiveautomation.com/t/alarm-changes-not-reflected-in-sql-tag/5507 "2012-11-30T14:45:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcorkern](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rcorkern](https://forum.inductiveautomation.com/u/rcorkern)\
**Post date:** [November 30, 2012, 2:45pm UTC](https://forum.inductiveautomation.com/t/alarm-changes-not-reflected-in-sql-tag/5507/1 "2012-11-30T14:45:53Z")

</div>

I have an editable table that we are using to update a few alert params that have already been created. The alerts are being created fine, but when we edit an alert value from the editable table the change is reflected in the db but not in the SQL tag itself. Any ideas on what I have wrong in this update? Here is the event handler cell edited script that we’re using to do the edits:

table = event.source.parent.TableName  
pk = event.source.parent.PrimaryKey  
colName = event.source.data.getColumnName(event.column)  
low = “low”  
high = “high”  
stateID = event.source.parent.selectedTagID  
params = [event.newValue]

# Handle the case where there are multiple primary keys

pks = [x.strip() for x in pk.split(",")]  
where=""  
for key in pks:  
where += key + "=? AND "

# remove trailing AND

where = where[:-5]  
query = “UPDATE %s SET %s=? WHERE %s”% (table, colName, where)  
query1 = “UPDATE %s SET %s=? WHERE %s”% (table, low, where)  
query2 = “UPDATE %s SET %s=? WHERE %s”% (table, high, where)

params = [event.newValue]  
for key in pks:  
params.append(event.source.data.getValueAt(event.row, key))

if event.source.selectedColumn==3:  
fpmi.db.runPrepStmt(query, params)

if event.source.selectedColumn==4:  
fpmi.db.runPrepStmt(query1, params)  
fpmi.db.runPrepStmt(query2, params)

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [November 30, 2012, 4:28pm UTC](https://forum.inductiveautomation.com/t/alarm-changes-not-reflected-in-sql-tag/5507/2 "2012-11-30T16:28:16Z")

</div>

That is correct. We only put data into the alert history. The tag shows the current status of the alarm which comes from memory not the alert history table.
