# Named query script

**URL:** <https://forum.inductiveautomation.com/t/named-query-script/34459>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 5, 2020, 7:17pm UTC](https://forum.inductiveautomation.com/t/named-query-script/34459 "2020-05-05T19:17:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankitkarwa21](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@ankitkarwa21](https://forum.inductiveautomation.com/u/ankitkarwa21)\
**Post date:** [May 5, 2020, 7:17pm UTC](https://forum.inductiveautomation.com/t/named-query-script/34459/1 "2020-05-05T19:17:56Z")

</div>

I am running a simple named query that adds an entry to the database.  
However, I am finding that none of the scripts after the system.runNamedQuery command arent executing.

```auto
	system.db.runNamedQuery("NamedQuery", params)
	self.refreshBinding("props.data")
	system.perspective.print("Added entry ")

```

I am printing a text to the console to confirm the script was executed.  
Console didnt print anything but entry was added to the database.  
Any reasons why this would happen?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [May 5, 2020, 7:38pm UTC](https://forum.inductiveautomation.com/t/named-query-script/34459/2 "2020-05-05T19:38:40Z")

</div>

1. What version are you using?
2. Did you check your Gateway to see if any errors were logged?

---

<div class="post-metadata">

**Author:** ![ankitkarwa21](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@ankitkarwa21](https://forum.inductiveautomation.com/u/ankitkarwa21)\
**Post date:** [May 5, 2020, 7:47pm UTC](https://forum.inductiveautomation.com/t/named-query-script/34459/3 "2020-05-05T19:47:14Z")

</div>

Version 8.0.12

Here's the error message from the gateway logs.

> Blockquote  
> Error running Page/UI/ItemMaster@C/root/FlexContainer/TabContainer\_0/FlexContainer/Table.onMessageReceived(self, payload): Traceback (most recent call last): File "function:onMessageReceived", line 6, in onMessageReceived at com.inductiveautomation.ignition.gateway.db.namedquery.NamedQueryExecutor$NamedQueryInstance.execute(NamedQueryExecutor.java:413) at com.inductiveautomation.ignition.gateway.db.namedquery.NamedQueryExecutor.execute(NamedQueryExecutor.java:176) at com.inductiveautomation.ignition.gateway.db.namedquery.GatewayNamedQueryManager.execute(GatewayNamedQueryManager.java:88) at com.inductiveautomation.ignition.common.db.namedquery.SecuredNamedQueryManager.execute(SecuredNamedQueryManager.java:43) at com.inductiveautomation.ignition.gateway.script.GatewayDBUtilities.runNamedQuery(GatewayDBUtilities.java:402) at jdk.internal.reflect.GeneratedMethodAccessor217.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) java.lang.Exception: java.lang.Exception: com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.

I changed the query type and that fixed the issue
