Hello,
I am trying to execute a update query having 3 parameters in that.
below is my query-
query = "update [dbo].[Manual_DowntimeEditTable] set [DowntimeEnd] = ? where lineId = ? and SideName=’%s’ and [DowntimeEnd] is NULL "
count = system.db.runPrepUpdate(query,[endDate,lineId,side], runtimeDB)
and I am getting this exception while executing this query-
java.lang.Exception: Error executing system.db.runPrepUpdate(update [dbo].[Manual_DowntimeEditTable] set [DowntimeEnd] = ? where lineId = ? and SideName=’%s’ and [DowntimeEnd] is NULL , [2020-05-06 12:00:00.000, 2258, 0], SFDCS_OEE, , false, false)
What is wrong in this?
I am using Ignition Version: 7.9.13 (b2019120915)
Please help me to get out of this.
It looks like you have more parameters in your second argument than you have references to in your query text. There are two ‘?’ in your query, so there should be two items in your list.
You will need to use a question mark. You don’t need to put it in quotes, if that’s what you’re asking. Anywhere in the query text you put a ? will be filled by an object from the list in the second argument. When you provide a string in the list, it will be handled gracefully by the function.