# Problem with system.db.runquery , index out of range

**URL:** <https://forum.inductiveautomation.com/t/problem-with-system-db-runquery-index-out-of-range/37652>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [August 12, 2020, 2:57pm UTC](https://forum.inductiveautomation.com/t/problem-with-system-db-runquery-index-out-of-range/37652 "2020-08-12T14:57:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tamerplc](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tamerplc](https://forum.inductiveautomation.com/u/tamerplc)\
**Post date:** [August 12, 2020, 2:57pm UTC](https://forum.inductiveautomation.com/t/problem-with-system-db-runquery-index-out-of-range/37652/1 "2020-08-12T14:57:06Z")

</div>

I had an error for retrieving data from one table … more than Row[48] script giving below error. it seems max index is 49 more than 49, the script gave an error .  
Is there any workaround??

```auto
Traceback (most recent call last):
  File "<input>", line 15, in <module>
IndexError: Column index 49 out of range.

```

Script :

```auto
query= "select top 1 * from MSK where process_id in ('process1','process2','process3','process4') order by id desc"
table = system.db.runQuery(query,'dbname')"
for row in table:
   NewValue=row[0], row[49]
print NewValue

```

---

<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:** [August 12, 2020, 3:32pm UTC](https://forum.inductiveautomation.com/t/problem-with-system-db-runquery-index-out-of-range/37652/2 "2020-08-12T15:32:15Z")

</div>

Your error is for the column index, not a row index.

---

<div class="post-metadata">

**Author:** ![tamerplc](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tamerplc](https://forum.inductiveautomation.com/u/tamerplc)\
**Post date:** [August 12, 2020, 3:55pm UTC](https://forum.inductiveautomation.com/t/problem-with-system-db-runquery-index-out-of-range/37652/3 "2020-08-12T15:55:34Z")

</div>

Yes, error in my script .Thanks Phil
