# UPDATE SET Query on PB actionPerformed component scripting

**URL:** <https://forum.inductiveautomation.com/t/update-set-query-on-pb-actionperformed-component-scripting/31494>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [January 21, 2020, 8:59pm UTC](https://forum.inductiveautomation.com/t/update-set-query-on-pb-actionperformed-component-scripting/31494 "2020-01-21T20:59:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulm1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulm1/32/5900_2.png) [@paulm1](https://forum.inductiveautomation.com/u/paulm1)\
**Post date:** [January 21, 2020, 8:59pm UTC](https://forum.inductiveautomation.com/t/update-set-query-on-pb-actionperformed-component-scripting/31494/1 "2020-01-21T20:59:58Z")

</div>

Running the following script, everything seems to work except my UPDATE SET Query for t\_stamp in table named prevent. See Below.

 ![PB%20UPDATE%20SET%20Query](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5e41087a14828f203af66df5a019d50e5b71fe6e.png)

Here is the MySQL error I get.

```
 Traceback (most recent call last):
 File "<event:actionPerformed>", line 16, in <module>
java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(UPDATE 
prevent SET (t_stamp) Values (?) WHERE id LIKE ?, [Tue Jan 21 12:57:27 PST 2020, 101.12], , , 
false, false)
caused by Exception: Error executing system.db.runPrepUpdate(UPDATE prevent SET (t_stamp) Values (?) WHERE id LIKE ?, [Tue Jan 21 12:57:27 PST 2020, 101.12], , , false, false)
caused by GatewayException: SQL error for "UPDATE prevent SET (t_stamp) Values (?) WHERE id LIKE ?": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(t_stamp) Values ('2020-01-21 12:57:27.166') WHERE id LIKE 101.12' at line 1
caused by MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(t_stamp) Values ('2020-01-21 12:57:27.166') WHERE id LIKE 101.12' at line 1
Ignition v7.9.4 (b2017082911)
Java: Oracle Corporation 1.8.0_231
```

---

<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 21, 2020, 9:06pm UTC](https://forum.inductiveautomation.com/t/update-set-query-on-pb-actionperformed-component-scripting/31494/2 "2020-01-21T21:06:24Z")

</div>

That is not the syntax for an UPDATE.

`system.db.runPrepUpdate("UPDATE prevent SET t_stamp = ? WHERE id = ?",[EntryTime,ID])`

---

<div class="post-metadata">

**Author:** ![paulm1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulm1/32/5900_2.png) [@paulm1](https://forum.inductiveautomation.com/u/paulm1)\
**Post date:** [January 21, 2020, 9:12pm UTC](https://forum.inductiveautomation.com/t/update-set-query-on-pb-actionperformed-component-scripting/31494/3 "2020-01-21T21:12:01Z")

</div>

Perfect. Thank you so much for your assistance.
