My ignition current version is 8.1.0RC1
In my version module power table I have 2 issue:
Problem 1:
if system.gui.confirm(u'记录将删除, 请确认?'):
RequestDateTime=event.source.parent.getComponent('Power Table').RequestDateTime
query="""
DELETE FROM [dbo].[NTCOATest]
WHERE RequestDateTime=?
"""
system.db.runPrepUpdate(query,[RequestDateTime],'NTLog')
table=event.source.parent.getComponent("Power Table")
system.db.refresh(table,"data")
Here is the time what I get
SELECT
[WO_ID]
, [RequestDateTime]
FROM [NTLog].[dbo].[NTCOATest]
WHERE RequestDate>='{Root Container.From.selectedLabel}'
AND RequestDate<='{Root Container.To.selectedLabel}'
ORDER BY WO_ID
Before 8.1.0RC1 , I can make this logic work, but after update to 8.1.0RC1 , I found it can’t work , due to the date format is changed, my question is in 8.1 version , if I have a datetime in the SQL table, if I want to update the query based on it’s timestamp, how to scripting ?
Problem 2:
import system
id = self.data.getValueAt(rowIndex, "WO_ID")
query = "UPDATE [dbo].[NTCOATest] SET %s = ? WHERE [WO_ID] = ?" % (colName)
args = [newValue, id]
system.db.runPrepUpdate(query, args, 'NTLog')
system.db.refresh(self, "data")
I have a table I scripting is able to update base on the upside logic
when I click the null column and do no change, then I click other column,
this null value will update to 0 ,how to avoid these problem happen?
thanks a lot