# system.db.runNamedQuery update returns the statement "did not return a result set"

**URL:** <https://forum.inductiveautomation.com/t/system-db-runnamedquery-update-returns-the-statement-did-not-return-a-result-set/42335>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [January 17, 2021, 5:04am UTC](https://forum.inductiveautomation.com/t/system-db-runnamedquery-update-returns-the-statement-did-not-return-a-result-set/42335 "2021-01-17T05:04:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffgrinn](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jeffgrinn](https://forum.inductiveautomation.com/u/jeffgrinn)\
**Post date:** [January 17, 2021, 5:04am UTC](https://forum.inductiveautomation.com/t/system-db-runnamedquery-update-returns-the-statement-did-not-return-a-result-set/42335/1 "2021-01-17T05:04:55Z")

</div>

I am calling a named query with parameters that properly executes the update of an MS SQL row, however it returns the following error: “The statement did not return a result set”

Below is the query call within the Query Editor of a Button Component:

params = {“ID\_to\_Update” : event.source.parent.getComponent(‘ID\_Field’).value,  
“itemNameInput” : event.source.parent.getComponent(‘Item\_Name\_Field’).text,  
“inventoryCountInput” : event.source.parent.getComponent(‘Inventory\_Count\_Field’).value,  
“locationInput” : event.source.parent.getComponent(‘Location\_Field’).selectedStringValue}

system.db.runNamedQuery(“TestSQL Update”, params)

Below is the Named Query, “TestSQL Update”:

UPDATE TestSQL  
SET Item\_Name = :itemNameInput, Inventory\_Count = :inventoryCountInput, Location = :locationInput  
WHERE ID = :ID\_to\_Update ;

The above executes correctly and updates the database properly but returns the error.

Appreciate any feedback I can get.

---

<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:** [January 17, 2021, 1:35pm UTC](https://forum.inductiveautomation.com/t/system-db-runnamedquery-update-returns-the-statement-did-not-return-a-result-set/42335/2 "2021-01-17T13:35:20Z")

</div>

In the named query editor, you have to set the query type to Update so the named query execution engine doesn’t expect a return dataset.

---

<div class="post-metadata">

**Author:** ![jeffgrinn](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jeffgrinn](https://forum.inductiveautomation.com/u/jeffgrinn)\
**Post date:** [January 17, 2021, 1:54pm UTC](https://forum.inductiveautomation.com/t/system-db-runnamedquery-update-returns-the-statement-did-not-return-a-result-set/42335/3 "2021-01-17T13:54:31Z")

</div>

Thanks! Worked. Appreciate the help.
