# Query Problem: A result set was generated for update

**URL:** <https://forum.inductiveautomation.com/t/query-problem-a-result-set-was-generated-for-update/106007>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 7, 2025, 8:51pm UTC](https://forum.inductiveautomation.com/t/query-problem-a-result-set-was-generated-for-update/106007 "2025-05-07T20:51:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Burger\_King](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@Burger\_King](https://forum.inductiveautomation.com/u/Burger_King)\
**Post date:** [May 7, 2025, 8:51pm UTC](https://forum.inductiveautomation.com/t/query-problem-a-result-set-was-generated-for-update/106007/1 "2025-05-07T20:51:25Z")

</div>

I am having periodic issues running a query in my Ignition script. I have a select statement and I am inserting the rows returned. Example below

```python
INSERT INTO *my_table* ()
SELECT columns FROM *a_different_table*

```

Most of the time the query runs without issue but sometimes when it runs, I get an error and see this in the log `A result set was generated for update.`

I have also tried using `SET NOCOUNT ON` in my query but I get the same error.

I am using this command to run the query `system.db.runPrepInsert()` but recently changed it to `system.db.runPrepUpdate()`. But I am not confident that it will work so I'd like to ask if maybe someone has a different solution that I haven't tried.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [May 7, 2025, 9:23pm UTC](https://forum.inductiveautomation.com/t/query-problem-a-result-set-was-generated-for-update/106007/2 "2025-05-07T21:23:34Z")

</div>

When you run that query outside of Ignition, does it return the Select resultset?  
If so, you need to use system.db.runPrepQuery() otherwise Ignition panics as you are returning data.
