EDIT : It works when I try with prepUpdate as below,
from java.util import Calendar query = "UPDATE myTable SET date_created = ? WHERE id = 1" arg = [cal.getTime()] system.db.runUpdateQuery(query, arg)
But, still looking a way without Prep Query.
We have a Ignition server in French Locale. I am trying to write update queries from Ignition with scripting (I must do this way).
Since, it gave me an errors I tried different ways as below with script console:
query = "UPDATE myTable SET date_created ='2020-08-21 00:00:00' WHERE id = 1" system.db.runQuery(query)
query = "UPDATE myTable SET date_created ='08-21-2020 00:00:00' WHERE id = 1" system.db.runQuery(query)
from java.util import Calendar cal = Calendar.getInstance() query = "UPDATE myTable SET date_created ='%s' WHERE id = 1"%(cal.getTime()) system.db.runQuery(query)
But, all of them throws different exceptions rejecting to convert the date into JDBC compatible format.
How do I write dateTime to SQL with scripting ?
The Date Format we have working for servers in North America is :
Thanks so much in advance