# runUpdateQuery script

**URL:** <https://forum.inductiveautomation.com/t/runupdatequery-script/10709>\
**Category:** Ignition\
**Created:** [November 1, 2015, 11:12am UTC](https://forum.inductiveautomation.com/t/runupdatequery-script/10709 "2015-11-01T11:12:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CamJam](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@CamJam](https://forum.inductiveautomation.com/u/CamJam)\
**Post date:** [November 1, 2015, 11:12am UTC](https://forum.inductiveautomation.com/t/runupdatequery-script/10709/1 "2015-11-01T11:12:35Z")

</div>

Hi,

I have a script i use in my gateway scripts that looks to see if tables exist and create new tables if they dont exist.

in v7.7.5 i have something like this and it works  
system.db.runUpdateQuery(“CREATE TABLE IF NOT EXISTS email (EMAIL\_ID int(11) NOT NULL, EmailAddress varchar(255), PRIMARY KEY (EMAIL\_ID))”,‘System\_Data’)

in v7.8.0 running the same script i get errors like image attached

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5e45e788b0a3a6eac2f263b0e0e99bf8b911c335.JPG)  

Can someone maybe explain what is causing the error or how i can create a table in MySQL from a system.db script?

Thanks  
Cam

---

<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:** [November 1, 2015, 12:12pm UTC](https://forum.inductiveautomation.com/t/runupdatequery-script/10709/2 "2015-11-01T12:12:08Z")

</div>

Hi Cam,

The error message is cut off. Can you copy/paste the full error message?

Thanks,

---

<div class="post-metadata">

**Author:** ![CamJam](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@CamJam](https://forum.inductiveautomation.com/u/CamJam)\
**Post date:** [November 1, 2015, 7:20pm UTC](https://forum.inductiveautomation.com/t/runupdatequery-script/10709/3 "2015-11-01T19:20:29Z")

</div>

Hi, I have added the rest of the error in attached image

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2cc142adda72d610bb177fd3d68307d18c0886c2.JPG)  

Thanks, Cam

---

<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:** [November 1, 2015, 7:59pm UTC](https://forum.inductiveautomation.com/t/runupdatequery-script/10709/4 "2015-11-01T19:59:01Z")

</div>

Okay, thanks. That error message doesn’t say what is wrong. Perhaps execute the same script on a button and see if it gives a more detailed stacktrace which might give useful information about what is wrong.

Best,

---

<div class="post-metadata">

**Author:** ![CamJam](https://avatars.discourse-cdn.com/v4/letter/c/3ec8ea/32.png) [@CamJam](https://forum.inductiveautomation.com/u/CamJam)\
**Post date:** [November 1, 2015, 8:18pm UTC](https://forum.inductiveautomation.com/t/runupdatequery-script/10709/5 "2015-11-01T20:18:17Z")

</div>

Hi, the script works with a button (no errors). Just doesn’t work in the script editor or gateway?  
any reason why this would be?

Thanks,Cam

---

<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:** [November 1, 2015, 8:27pm UTC](https://forum.inductiveautomation.com/t/runupdatequery-script/10709/6 "2015-11-01T20:27:51Z")

</div>

Seems like a bug. I would submit a ticket to Inductive Automation about it.

Best,
