# Script to run named query and parse returned row of data from database

**URL:** <https://forum.inductiveautomation.com/t/script-to-run-named-query-and-parse-returned-row-of-data-from-database/100284>\
**Category:** Ignition\
**Tags:** database, ignition81, vision, scripting\
**Created:** [December 28, 2024, 3:27am UTC](https://forum.inductiveautomation.com/t/script-to-run-named-query-and-parse-returned-row-of-data-from-database/100284 "2024-12-28T03:27:02Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [December 28, 2024, 6:59pm UTC](https://forum.inductiveautomation.com/t/script-to-run-named-query-and-parse-returned-row-of-data-from-database/100284/10 "2024-12-28T18:59:12Z")

</div>

> [@pturmel](#):
>
> (You should not need **any** script

I've run into situations where I get internmittent overlays with SQL bindings, which is what I imagined was happening in the [previous topic](https://forum.inductiveautomation.com/t/property-from-dataset/100280/4) concerning this same issue. When that happens, I get rid of the bindings and handle the data with scripting. Although, we're only getting one row here, so I can't imagine any reason why there would be any latency issues.

> [@Nicole\_McCormack](#):
>
> `AttributeError: 'java.util.ArrayList' object has no attribute 'value'`

This is happening because readblocking returns a list. This needs to be written like this:

```python
system.tag.readBlocking(["[default]MLWinTags/localVars/currentStepNumber"])[0].value

```

Note the addition of the `[0]` index value

---

_[View the full topic](https://forum.inductiveautomation.com/t/script-to-run-named-query-and-parse-returned-row-of-data-from-database/100284)._
