Why is a parameter name in a named query giving me and index out of bound error?

Hi there. I'm going through Inductive university and I'm following along with the videos and I have run into a strange error when working with named queries. I have 2 named queries that are using the same parameter name, which I named colName. The first named query used colName to filter the column on my table. My second named query is suppose to do a conditional filtered selection. However, in this second named query, when ever I go to execute the query I get an error stating "java.lang.ArrayIndexOutOfBoundsException". I have copied the code from the first query and pasted it into the second query and the same thing happens. The index out of bounds error goes away when I change the name of the parameter in the second query. Why would this fix it?
I do not have any experience with SQL, so forgive me if I seem a bit ignorant.

Thank you.

You’re going to have to show the named queries, and how you are calling them.

I highly suspect that the error is not coming from the queries, but rather from how they are being called.

Is your named query a script instead of a single statement? If so, and you have comments, you might screw up Ignition's attempt to be friendly.

(Don't use SQL scripts--they are not officially supported by vanilla JDBC.)

1 Like

Also, what version of Ignition are you using?

I did have a comment on the named query that was not working. I tried taking the comment out and that did it! My named query was able to execute. I'll just have to keep notes on my queries in a different way than within the script itself. Thank you very much for your help!

1 Like

I am using Ignition 8.1. I am not calling my named queries from anywhere with in the project, I am using the testing tab within the named query editor. I appreciate your time for replying to my post!