# Error - I'm getting a result set?

**URL:** <https://forum.inductiveautomation.com/t/error-im-getting-a-result-set/26862>\
**Category:** Ignition\
**Created:** [July 24, 2019, 10:07pm UTC](https://forum.inductiveautomation.com/t/error-im-getting-a-result-set/26862 "2019-07-24T22:07:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dholt](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dholt/32/4458_2.png) [@dholt](https://forum.inductiveautomation.com/u/dholt)\
**Post date:** [July 24, 2019, 10:07pm UTC](https://forum.inductiveautomation.com/t/error-im-getting-a-result-set/26862/1 "2019-07-24T22:07:01Z")

</div>

Trying to write to a tag the results of a query on a button press. This is script:

> query = """SELECT \* FROM FORECASTS"""  
> r = system.db.runUpdateQuery(query, "MurakamiSQL")  
> system.tag.write(Forecastedcomps,r)

This is error:

> Traceback (most recent call last):  
> File "event:mousePressed", line 2, in   
> java.lang.Exception: java.lang.Exception: Error executing system.db.runUpdateQuery(SELECT \* FROM FORECASTS, MurakamiSQL, , false)
> 
> caused by Exception: Error executing system.db.runUpdateQuery(SELECT \* FROM FORECASTS, MurakamiSQL, , false)  
> caused by GatewayException: SQL error for "SELECT \* FROM FORECASTS": A result set was generated for update.  
> caused by SQLServerException: A result set was generated for update.
> 
> Ignition v8.0.2 (b2019060511)  
> Java: Azul Systems, Inc. 11.0.3

Am I just misunderstanding this? Shouldn't I be getting a result set, and shouldn't it be writing to the tag?

---

<div class="post-metadata">

**Author:** ![nick.schuetz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nick.schuetz/32/6160_2.png) [@nick.schuetz](https://forum.inductiveautomation.com/u/nick.schuetz)\
**Post date:** [July 24, 2019, 10:08pm UTC](https://forum.inductiveautomation.com/t/error-im-getting-a-result-set/26862/2 "2019-07-24T22:08:52Z")

</div>

You are using the system.runUpdateQuery() which is expecting just an integer value of the number of rows updated.  
Try using system.db.runQuery().

---

<div class="post-metadata">

**Author:** ![dholt](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dholt/32/4458_2.png) [@dholt](https://forum.inductiveautomation.com/u/dholt)\
**Post date:** [July 24, 2019, 10:14pm UTC](https://forum.inductiveautomation.com/t/error-im-getting-a-result-set/26862/3 "2019-07-24T22:14:03Z")

</div>

You my friend are awesome! Thank you!
