# Store and Forward via scripting

**URL:** <https://forum.inductiveautomation.com/t/store-and-forward-via-scripting/107465>\
**Category:** Ignition\
**Tags:** database, scripting, perspective\
**Created:** [June 17, 2025, 9:49am UTC](https://forum.inductiveautomation.com/t/store-and-forward-via-scripting/107465 "2025-06-17T09:49:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![svatsal77](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@svatsal77](https://forum.inductiveautomation.com/u/svatsal77)\
**Post date:** [June 17, 2025, 9:49am UTC](https://forum.inductiveautomation.com/t/store-and-forward-via-scripting/107465/1 "2025-06-17T09:49:58Z")

</div>

I have a script in which I am performing an insert operation on my database table.  
While the script is running there may arise a situation where the database connection is faulted and the insert query fails.  
How can I leverage store and forward functionality to avoid data loss?  
Or pls suggest any other solution to prevent data loss

---

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](https://forum.inductiveautomation.com/u/djs)\
**Post date:** [June 17, 2025, 12:19pm UTC](https://forum.inductiveautomation.com/t/store-and-forward-via-scripting/107465/2 "2025-06-17T12:19:51Z")

</div>

There are scripting functions that run queries through the Store and Forward system:

- [system.db.runSFNamedQuery()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-db/system.db.runSFNamedQuery)
- [system.db.runSFUpdateQuery()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-db/system-db-runSFUpdateQuery)
- [system.db.runSFPrepUpdate()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-db/system-db-runSFPrepUpdate)
