Issue - The Index is Out of Range

Hi,

I’ve updated the version from Ignition 8.1.24 to 8.1.42. However, we’ve noticed an issue with the named queries. It appears that using query within SQL queries now triggers an "out of range" error. After deleting the comments, the functionalities worked as expected.

Why the issue occurred? Are there any possibilities to add comments in namedQuery?

image

IIRC comment ability was added and then removed because it other things.

At the moment, I don't believe there is a way to add comments in-line in a named query.

1 Like

Comments are not defined for SQL statements. They are only defined for SQL scripts, which are not officially supported by JDBC. Some JDBC drivers support them anyways, but there is no parsing support for a JDBC client to distinguish important parts of your SQL from the comments. Which means the convenience of using colon-delimited named parameters, which are implemented by Ignition, not JDBC, is fundamentally incompatible with SQL comments.

Don't hold your breath waiting for this to change. (IA already burned their fingers on this.)

1 Like