Named query script

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.

	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?

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

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

2 Likes