# Named Query Help Vision

**URL:** <https://forum.inductiveautomation.com/t/named-query-help-vision/62881>\
**Category:** Ignition\
**Tags:** namedqueries, ignition79\
**Created:** [August 10, 2022, 5:02pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881 "2022-08-10T17:02:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 5:02pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/1 "2022-08-10T17:02:48Z")

</div>

Hey there so I am currently having some troubles with named queries. I am using 7.9 and Vision.

The issue that I am running into is that I can create, bind, and see all the data from my named queries that pull data from our MES data base to show metrics but as soon as I try to open a client all the named queries are blank.

This only happens when Ignition is trying to pull from the MES database but I am not sure why? I have enabled all permissions on the client side (although I think named queries shouldn’t be ran client side?) but still no luck.

On one of the test applications I am messing around in I was able to circumvent this problem (don’t think this is best practice) by having the query be in a tag and then binding the data element of the table I want to the tag value.

There is no error message in the console from the queries failing to run and when I test them in the named query browser they work perfectly fine.

Any help would be greatly appreciated 😃 thank you!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 10, 2022, 5:05pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/2 "2022-08-10T17:05:40Z")

</div>

> [@mforrest](#):
>
> I am using 7.9 and Perspective.

Wasn't Perspective introduced with Version 8?

Are you passing parameters into your named queries? It's going to be difficult to help without some code.

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 5:09pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/3 "2022-08-10T17:09:25Z")

</div>

Sorry about that I meant vision, currently in the process of the upgrade but still on vision at the moment. And for I can post some code, not really sure what code would be helpful.

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 5:10pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/4 "2022-08-10T17:10:24Z")

</div>

And yes I am passing the parameters into the named query in the binding property pop up that appears when I assign the binding. Also here is a snippet of one of the simple named queries that isn’t populating in the client view.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/c/ccffb5dd3e1a41462769865c3c7df6df9559ce28.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 10, 2022, 5:57pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/5 "2022-08-10T17:57:10Z")

</div>

You have Query Type set to _Query_ but the actual query looks like it should return a scalar value.  
Should the Query Type be set to _Scalar Query_?  
What is the binding expecting? A dataset, a document (JSON) or a scalar (a single value)?

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 7:06pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/6 "2022-08-10T19:06:19Z")

</div>

Hmm that particular one is expecting a scalar value for sure and I will definitely make that change but I also have a table that is expecting a dataset that is also not populating. I am going to change that to a scalar real quick and report back

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 7:07pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/7 "2022-08-10T19:07:57Z")

</div>

So I just checked and changing it to scalar didn’t fix the issue, one thing I did notice is that the values flash once then disappear almost immediately.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 10, 2022, 7:09pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/8 "2022-08-10T19:09:13Z")

</div>

It sounds like something else is overwriting the binding. Have you some scripts running on the gateway writing to the components?

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 7:11pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/9 "2022-08-10T19:11:04Z")

</div>

No I don’t have anything setting these values except the binding, I also have disabled the security on the named query in case that was the issue but that didn’t fix it either.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 10, 2022, 7:19pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/10 "2022-08-10T19:19:30Z")

</div>

Is the data showing up in the binding preview?  
If so, then

- Add a fresh Table component onto the view.
- Run it and check that the Folsom default data is showing up.
- Copy the original table’s qieru binding (using right-click, Copy Binding / Paste Binding) and see if the table renders properly. If it does then you may have some wonky column or CSS settngs on the original table.

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 7:21pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/11 "2022-08-10T19:21:41Z")

</div>

It is showing up in the binding preview, and I just put a brand new table in there and still no luck

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 7:23pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/12 "2022-08-10T19:23:20Z")

</div>

I did just notice that when I take a look in the db browser it says “Error Listing Columns”, but I am not sure why because I am able to query it in the designer view, I’m pretty stumped.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 10, 2022, 7:27pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/13 "2022-08-10T19:27:10Z")

</div>

If there’s anything in the table’s datasource then post it here. (Use the \</\> button to format it. You can also use the ⚙ _Hide Details_ feature if you want to collapse the JSON.)

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 7:30pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/14 "2022-08-10T19:30:51Z")

</div>

Sorry quick clarification, the component table’s data property, is that the table’s datasource?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 10, 2022, 7:33pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/15 "2022-08-10T19:33:09Z")

</div>

Yes, `props.data`. I was going from (dodgy) memory.

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 7:34pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/16 "2022-08-10T19:34:02Z")

</div>

OOOOO quick question if you know, how does ignition deal with spaces in the tables inside of the database, when I click on the table it gives me an error and says that the name is an invalid object but only lists the first part of the db name until the first space.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/d/1d99a2586a00ad021d71f67eb4c278e2579f1c84.png)

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 7:38pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/17 "2022-08-10T19:38:27Z")

</div>

Welp doesn’t appear to be the issue either, same error when I click a db with no spaces in the name

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 10, 2022, 7:39pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/18 "2022-08-10T19:39:09Z")

</div>

Sorry, I don’t know. My earlier data source instruction was for Perspective. I forgot this is a 7.9 Vision project. Sorry.

---

<div class="post-metadata">

**Author:** ![mforrest](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@mforrest](https://forum.inductiveautomation.com/u/mforrest)\
**Post date:** [August 10, 2022, 7:39pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/19 "2022-08-10T19:39:10Z")

</div>

Also when I print the .data property from the client view it returns ‘Dataset [0R ? 4C]’

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 10, 2022, 7:39pm UTC](https://forum.inductiveautomation.com/t/named-query-help-vision/62881/20 "2022-08-10T19:39:52Z")

</div>

Zero rows, four columns. No data. Hmmm.

[Next page](https://forum.inductiveautomation.com/t/named-query-help-vision/62881.md?page=2)
