runUpdateQuery script

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


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

Hi Cam,

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

Thanks,

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


Thanks, Cam

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,

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

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

Best,