# Help! system.db.runPrepUpdate error

**URL:** <https://forum.inductiveautomation.com/t/help-system-db-runprepupdate-error/8140>\
**Category:** Ignition\
**Created:** [March 11, 2014, 7:40pm UTC](https://forum.inductiveautomation.com/t/help-system-db-runprepupdate-error/8140 "2014-03-11T19:40:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![controlsim](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@controlsim](https://forum.inductiveautomation.com/u/controlsim)\
**Post date:** [March 11, 2014, 7:40pm UTC](https://forum.inductiveautomation.com/t/help-system-db-runprepupdate-error/8140/1 "2014-03-11T19:40:11Z")

</div>

Hi, I have this database created and I want to insert data but I get error

[i]CREATE TABLE inventory  
(  
id int NOT NULL AUTO\_INCREMENT,  
name varchar(255) NOT NULL,  
description varchar(255) not null,

PRIMARY KEY (id)  
)[/i]

I have a button to insert data into the db, this is the script

[color=#4000BF]name= event.source.parent.getComponent(‘name’).text  
description = event.source.parent.getComponent(‘description’).text

system.db.runPrepUpdate(“INSERT INTO inventory (name,description) VALUES (?,?)”,[name],[description])[/color]

I get the following error

[color=#FF0000]Traceback (most recent call last):

File “event:actionPerformed”, line 5, in

java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO inventory (name,description) VALUES (?,?), [Product1], [u’Description1’], , false, false)

```
caused by Exception: Error executing system.db.runPrepUpdate(INSERT INTO inventory (name,description) VALUES (?,?), [Product1], [u'Description1'], , false, false)
caused by GatewayException: Connection Error: Datasource "[u'Description1']" does not exist in this Gateway.
caused by SQLException: Datasource "[u'Description1']" does not exist in this Gateway.

```

Ignition v7.6.4 (b2013112117)  
Java: Oracle Corporation 1.7.0\_25[/color]

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [March 11, 2014, 7:47pm UTC](https://forum.inductiveautomation.com/t/help-system-db-runprepupdate-error/8140/2 "2014-03-11T19:47:01Z")

</div>

You need one list of values, not two lists.

Change your function call to this:

```auto
system.db.runPrepUpdate("INSERT INTO inventory (name,description) VALUES (?,?)",[name, description])
```

---

<div class="post-metadata">

**Author:** ![controlsim](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@controlsim](https://forum.inductiveautomation.com/u/controlsim)\
**Post date:** [March 11, 2014, 7:53pm UTC](https://forum.inductiveautomation.com/t/help-system-db-runprepupdate-error/8140/3 "2014-03-11T19:53:10Z")

</div>

Thanks a lot that worked!
