# Script help, preventing redundant rows, overwriting with prepupdate

**URL:** <https://forum.inductiveautomation.com/t/script-help-preventing-redundant-rows-overwriting-with-prepupdate/58361>\
**Category:** Ignition\
**Created:** [April 12, 2022, 4:31pm UTC](https://forum.inductiveautomation.com/t/script-help-preventing-redundant-rows-overwriting-with-prepupdate/58361 "2022-04-12T16:31:59Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 12, 2022, 6:09pm UTC](https://forum.inductiveautomation.com/t/script-help-preventing-redundant-rows-overwriting-with-prepupdate/58361/3 "2022-04-12T18:09:32Z")

</div>

I highly recommend @lrose 's first suggestion over the second. The first one allows your scripting to be much easier as well and lets you write in the pythonic way of trying to do something and then failing gracefully. The second way you have a race condition and could have two clients who both check for a redundant record, both don’t see one, and then both insert, leaving you with a redundant record.

Check out this post - [Insert into database only if the entry doesn't exist - #2 by bkarabinchak.psi](https://forum.inductiveautomation.com/t/insert-into-database-only-if-the-entry-doesnt-exist/35122/2)

---

_[View the full topic](https://forum.inductiveautomation.com/t/script-help-preventing-redundant-rows-overwriting-with-prepupdate/58361)._
