Gateway Timer Script

I’m trying to run a gateway script that updates an sql table with data from another table, the script is basically a few queries from a table manipulated and added to a few strings then an update query to another table.
When I include this in a timer script it causes an error on the console even though it runs fine when put behind a button.
see screen shots for error.
I’m not sure what I’m doing wrong.
Ignition is version 7.1.3


A few things might help us track down what’s going on- first off, unfortunately some info is lost when looking at errors though the gateway page. Could you attach the “wrapper.log” file from the install directory or email it to support (at That will show what the actual error is.

Second, could you post the script here that is being executed? When posting it, surround it with the [c o d e] tag in order to keep the formatting.


For step 1 please find attched is the wrapper.log file, I’ll post the script tomorrow.
wrapper.log (428 KB)

Ah, good. That log is much clearer (and illustrates the need for us to improve that gateway console- something that’s been on the to-do list for a bit now).

Anyhow, from the log we see this:

[quote]Error running query “SELECT name FROM syscolumns WHERE id = 1125579048 AND name LIKE ‘%Running’”.
Unknown typecode: -9[/quote]
It appears that the “name” column is being returned as a data type that we don’t currently handle. This will be fixed for the next update. In the meantime, you can get around this by changing your query to cast the return to a supported type, such as:

SELECT cast(name as varchar) FROM syscolumns WHERE id = 1125579048 AND name LIKE '%Running