# Problems with system.db.runPrepUpdate()

**URL:** <https://forum.inductiveautomation.com/t/problems-with-system-db-runprepupdate/23720>\
**Category:** Ignition\
**Created:** [March 29, 2019, 9:02pm UTC](https://forum.inductiveautomation.com/t/problems-with-system-db-runprepupdate/23720 "2019-03-29T21:02:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![v.fernando1331](https://avatars.discourse-cdn.com/v4/letter/v/a4c791/32.png) [@v.fernando1331](https://forum.inductiveautomation.com/u/v.fernando1331)\
**Post date:** [March 29, 2019, 9:02pm UTC](https://forum.inductiveautomation.com/t/problems-with-system-db-runprepupdate/23720/1 "2019-03-29T21:02:11Z")

</div>

**I need to add information on a MySQL Database and this is the scribt:**

 ![script](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/1c6a48eaf249fbf2af9057a76e812fd86bcdd2d5.png)

**When I use the project, l have this error:**

_Traceback (most recent call last):_

\_ File “event:actionPerformed”, line 9, in \_

_java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO datos\_generales (Formulador, LoteG, LoteL, Tanda, Tanque, Num) VALUES (?,?,?,?,?), [[System]Client/User/Username, 5, 6, 7, 8], , , false, false)_

\_ caused by Exception: Error executing system.db.runPrepUpdate(INSERT INTO datos\_generales (Formulador, LoteG, LoteL, Tanda, Tanque, Num) VALUES (?,?,?,?,?), [[System]Client/User/Username, 5, 6, 7, 8], , , false, false)\_  
\_ caused by GatewayException: SQL error for “INSERT INTO datos\_generales (Formulador, LoteG, LoteL, Tanda, Tanque, Num) VALUES (?,?,?,?,?)”: Unknown column ‘Formulador’ in ‘field list’\_  
\_ caused by SQLSyntaxErrorException: Unknown column ‘Formulador’ in ‘field list’\_

_Ignition v7.9.10 (b2018112821)_  
_Java: Oracle Corporation 1.8.0\_201_

 ![Error](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/521d55bf787971da3d1cd59851eca6d6d0eca2b3.png)

---

<div class="post-metadata">

**Author:** ![martinel3746](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@martinel3746](https://forum.inductiveautomation.com/u/martinel3746)\
**Post date:** [March 29, 2019, 9:58pm UTC](https://forum.inductiveautomation.com/t/problems-with-system-db-runprepupdate/23720/2 "2019-03-29T21:58:58Z")

</div>

Offhand, it looks like your system.db.runPrepUpdate is missing the database parameter.  
Documentation says it is optional but I always include it.  
My preference is to store the name of the database in a tag so I can switch between Dev, Test and Production databases without editing code or changing project settings.  
e.g.  
database = system.tag.read( ‘Config/Database’ ).value  
system.db.runPrepUpdate(query, args, database)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 29, 2019, 10:09pm UTC](https://forum.inductiveautomation.com/t/problems-with-system-db-runprepupdate/23720/3 "2019-03-29T22:09:04Z")

</div>

> [@v.fernando1331](#):
>
> \_ caused by SQLSyntaxErrorException: Unknown column ‘Formulador’ in ‘field list’\_

You either have the wrong table, or you're typing the column name incorrectly, or your database is enforcing case-sensitivity on the column identifier (unlikely).
