# Update Non Default Data Source

**URL:** <https://forum.inductiveautomation.com/t/update-non-default-data-source/2096>\
**Category:** Archived Topics\
**Created:** [August 4, 2010, 2:34pm UTC](https://forum.inductiveautomation.com/t/update-non-default-data-source/2096 "2010-08-04T14:34:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aidamcg](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aidamcg](https://forum.inductiveautomation.com/u/aidamcg)\
**Post date:** [August 4, 2010, 2:34pm UTC](https://forum.inductiveautomation.com/t/update-non-default-data-source/2096/1 "2010-08-04T14:34:18Z")

</div>

Hi

I am having some problems with an update script that is updating a database table that is not in the Default data source. The script is been run from an action performed of a button. I get an error while executing saying that there is a spelling error with the data source.

This is what I have tried but it is not working

fpmi.db.runUpdateQuery("UPDATE TBWorkOrder SET MachineID = 1 Where WorkOrderNumber = ‘1234567’ "),[TransOPT]

Am I using the correct syntax for an update to the non default data source?

Thanks

Aidan

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [August 4, 2010, 3:32pm UTC](https://forum.inductiveautomation.com/t/update-non-default-data-source/2096/2 "2010-08-04T15:32:11Z")

</div>

The code should be:`fpmi.db.runUpdateQuery("UPDATE TBWorkOrder SET MachineID = 1 Where WorkOrderNumber = '1234567'", "TransOPT")`

---

<div class="post-metadata">

**Author:** ![aidamcg](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aidamcg](https://forum.inductiveautomation.com/u/aidamcg)\
**Post date:** [August 9, 2010, 11:17am UTC](https://forum.inductiveautomation.com/t/update-non-default-data-source/2096/3 "2010-08-09T11:17:12Z")

</div>

Hi Travis

That worked OK for me

Aidan
