I am having an issue with named queries in the project browser. I am creating some simple named queries that work in the named query testing environment, work outside of Ignition in SQL Server, and work by calling the system.db.runPrepQuery function, but do not work when using the system.db.runNamedQuery function.
The error I am receiving when inputting in the script console:
Traceback (most recent call last):
File “”, line 1, in
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u2179’ in position 12: ordinal not in range(128)
This is a very generic Python error, but I cannot get past it. Tried encoding things to no avail, even returning a single 0 (“SELECT 0”) causes this issue.
Is this a scoping issue? Or some bug in running this function via scripting console?
When I try calling this function within Perspective, it simply tells me that the project name is not found - adding the project name as the first argument makes this work perfectly fine. So it looks like within perspective, you need to call the project name as the first argument in order to run the named query. That seems strange at first, but I think it makes sense if all scripts are now gateway-scoped. But that begs the question of why it doesn’t seem to function in the scripting console? Any ideas?
In addition, I seem to have a problem with my scripting environment, where the text look/feel is strange and the cursor do not line up properly. It’s off by about 1-2 spaces, so backspacing sometimes erases the incorrect character. Tabbing and spacing are the same. It doesn’t seem to be a problem on my VM, but on my host machine, so I imagine it is some configuration I don’t know about. Ideas?