Issues with Table Data Queries
The Query runs well under testing returning data as expected. When binding to the Table it returns the Error_Exception stating “Error_Exception-(“java.sql.SQLSyntaxErrorException: Unknown column' ‘Jammed’ in ‘where clause’”)
I’m sure I'm missing something. script provided in TXT
New Text Document.txt (2.7 KB)
Post your SQL query as preformatted text, see Wiki - how to post code on this forum. You can edit your post by clicking the pencil Icon in the bottom right. (I would recommend editing the original post to include everything you put in the second post)
What flavor of DB are you using? How are you testing your query before binding it? Are you testing inside of ignition using the query browser are you using an external database management tool, such as SSMS?
Ah wait, you are using query strings with double quotes. Double quotes are used for identifiers in SQL, use single quotes. Any chance you are converting from MySQL to SQL server or PostgreSQL?
You are using QueryString parameters to pass values. Don't do that. (You are somehow getting double quotes into your actual param, which are identifier delimiters in SQL, not value delimiters.)
Don't try to do your own delimiting of strings. Pass values as values. QueryString params are for SQL structure variation, and should never carry user-entered values.