# Placeholders in system.db.runPrepUpdate

**URL:** <https://forum.inductiveautomation.com/t/placeholders-in-system-db-runprepupdate/6918>\
**Category:** Ignition\
**Created:** [July 23, 2013, 10:46pm UTC](https://forum.inductiveautomation.com/t/placeholders-in-system-db-runprepupdate/6918 "2013-07-23T22:46:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhortig](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jhortig](https://forum.inductiveautomation.com/u/jhortig)\
**Post date:** [July 23, 2013, 10:46pm UTC](https://forum.inductiveautomation.com/t/placeholders-in-system-db-runprepupdate/6918/1 "2013-07-23T22:46:12Z")

</div>

I’m using the following script to delete rows from a database table:

id = event.source.id

if system.gui.confirm(“Are you sure you want to delete the selected Program?”):  
system.db.runPrepUpdate(“DELETE FROM fw\_6870101\_recipes WHERE fw\_6870101\_recipes\_ndx = ?”, [id])  
system.db.refresh(event.source.parent.getComponent(‘Dropdown’), “data”)  
system.gui.messageBox(“Program deleted”)

So far it works perfect.  
Now I need to be able to change the table name (fw\_6870101\_recipes). The customer wants a simple text field to enter another table name.

Can I use a placeholder as table name and how would the script look for this?

Thanks.

---

<div class="post-metadata">

**Author:** ![markdobtech](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@markdobtech](https://forum.inductiveautomation.com/u/markdobtech)\
**Post date:** [July 24, 2013, 11:56am UTC](https://forum.inductiveautomation.com/t/placeholders-in-system-db-runprepupdate/6918/2 "2013-07-24T11:56:58Z")

</div>

table = event.source.parent.getComponent(‘Text Field’).text  
system.db.runPrepUpdate(“DELETE FROM %s WHERE fw\_6870101\_recipes\_ndx = ?” % table, [id])

---

<div class="post-metadata">

**Author:** ![jhortig](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jhortig](https://forum.inductiveautomation.com/u/jhortig)\
**Post date:** [July 24, 2013, 2:39pm UTC](https://forum.inductiveautomation.com/t/placeholders-in-system-db-runprepupdate/6918/3 "2013-07-24T14:39:36Z")

</div>

Works!

Thank you
