Hi all,
My goal is to execute a select query, and then for each row assign “ASDF” to column 2. Sounds simple enough, but I’m still having trouble .
This is the code I have:
penList = fpmi.db.runQuery(query)
penListDataSet = fpmi.dataset.toDataSet(penList)
for i in range(len(penList)):
fpmi.dataset.updateRow(penListDataSet, i, {2: "ASDF"})
The problem is that when I check the penListDataSet values of column 2 afterwards, they are still the old values! I have also tried using the column name instead of the index, and I have tried using setValue instead of updateRow. In all cases I still get the same result. I have also tried editing penList directly, which is a PyDataSet, but this gives an error. Is my mistake just too obvious for me to see?
Also, what are the differences between PyDataSets and DataSets? I’ve noticed that I get errors when I use len() on a DataSet, or if I use a DataSet in a for loop (ie: “pen in penListDataSet”). Alternatively, I get errors whenever I try to do any editing of a row in a PyDataSet. Is this all to be expected?
Thanks in advance,
Charles