# Problem with Script after update

**URL:** <https://forum.inductiveautomation.com/t/problem-with-script-after-update/12009>\
**Category:** Ignition\
**Created:** [August 5, 2016, 10:46am UTC](https://forum.inductiveautomation.com/t/problem-with-script-after-update/12009 "2016-08-05T10:46:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin.keefe](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@kevin.keefe](https://forum.inductiveautomation.com/u/kevin.keefe)\
**Post date:** [August 5, 2016, 10:46am UTC](https://forum.inductiveautomation.com/t/problem-with-script-after-update/12009/1 "2016-08-05T10:46:12Z")

</div>

I have just updated a project from V7.7.4 to V7.8.3 and have found that one of the scripts will not function correctly.  
Basically I am taking data from a Dataset and entering it into a SQL table.  
Under V7.7.4 the script worked correctly, but since the upgrade it now only enters the data from the first row of the dataset, but multiple times.  
The part of the script that does this is as follow:-

`#Insert details into batchChems table
	Ds_chems = event.source.parent.Ds_chems
	chemRowCount = (Ds_chems.rowCount)
	for x in range (chemRowCount):
		chemSection = event.source.parent.Fr_chemsSection
		chemAddOrder = event.source.parent.Fr_chemsAddOrder
		chemID = event.source.parent.Fr_chemsID
		chemQty = event.source.parent.Fr_chemsQty
		chemUOM = event.source.parent.Fr_chemsUOM
		chemBatchQty = event.source.parent.Fr_chemsBatchQty
		chemActualQty = 0.0
		chemCompleted = 'False'
		chemDye = "chem"
		system.db.runPrepUpdate("INSERT INTO batchChems (batchID, section, additionOrder, chemID, qty, uom, batchQty, actualQty, completed, chemDye) VALUES (?,?,?,?,?,?,?,?,?,?)", [batchID, chemSection, chemAddOrder, chemID, chemQty,chemUOM, chemBatchQty, chemActualQty, chemCompleted, chemDye])
		Ds_chems = event.source.parent.Ds_chems
		chemRow = 0
		event.source.parent.Ds_chems = system.dataset.deleteRow(Ds_chems, chemRow)`

Any ideas as to what is going on?

KK

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 5, 2016, 2:46pm UTC](https://forum.inductiveautomation.com/t/problem-with-script-after-update/12009/2 "2016-08-05T14:46:33Z")

</div>

The assignment with the deleteRow() isn’t propagating inside your event. That it would in 7.7.4 is a flaw that makes event operations much more susceptible to infinite loops.  
You’ll have to use Ds\_chems.getValueAt(x, ‘columnName’) inside your loop to retrieve the values. It’ll be much faster than using bindings to retrieve the values, too.
