# system.db.runPrepUpdate syntax error

**URL:** <https://forum.inductiveautomation.com/t/system-db-runprepupdate-syntax-error/39186>\
**Category:** Ignition\
**Created:** [September 29, 2020, 2:22pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepupdate-syntax-error/39186 "2020-09-29T14:22:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonelv](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@leonelv](https://forum.inductiveautomation.com/u/leonelv)\
**Post date:** [September 29, 2020, 2:22pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepupdate-syntax-error/39186/1 "2020-09-29T14:22:28Z")

</div>

Hello Everyone,

I am newbie to ignition and with database. I have been trying to run the following script for my tables but it generates an error. I am using MySQL for my database. Any help or suggestion because I don’t what else to think of.

Thank you

 ![SystemDB](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/44e7daf7a1f02a9a787002b992bd108a1665a97d.png)

Traceback (most recent call last):  
File “event:actionPerformed”, line 25, in   
UPDATE part\_ref SET part\_group = @@IDENTITY WHERE part\_ndx = @@IDENTITY;  
INSERT INTO tool\_part\_rel (tool\_ndx, part\_group) VALUES (? ,@@IDENTITY), [8980, 2], , , false, false)

Caused by: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO part\_ref (part\_number,enabled) VALUES (?,1);  
UPDATE part\_ref SET part\_group = @@IDENTITY WHERE part\_ndx = @@IDENTITY;  
INSERT INTO tool\_part\_rel (tool\_ndx, part\_group) VALUES (? ,@@IDENTITY), [8980, 2], , , false, false)  
… 54 more  
Caused by: com.inductiveautomation.ignition.client.gateway\_interface.GatewayException: SQL error for “INSERT INTO part\_ref (part\_number,enabled) VALUES (?,1);  
UPDATE part\_ref SET part\_group = @@IDENTITY WHERE part\_ndx = @@IDENTITY;  
INSERT INTO tool\_part\_rel (tool\_ndx, part\_group) VALUES (? ,@@IDENTITY)”: 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 ‘UPDATE part\_ref SET part\_group = @@IDENTITY WHERE part\_ndx = @@IDENTITY;  
IN’ at line 2

Caused by: java.sql.SQLSyntaxErrorException: 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 ‘UPDATE part\_ref SET part\_group = @@IDENTITY WHERE part\_ndx = @@IDENTITY;  
IN’ at line 2

---

<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:** [September 29, 2020, 2:26pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepupdate-syntax-error/39186/2 "2020-09-29T14:26:35Z")

</div>

Lots of JDBC drivers don’t support SQL scripts. One statement at a time, using nothing but pure SQL.
