Issue
I am trying to write a MySQL query in Appsmith that checks for an equality condition with the appsmith parameter, but I need to use both the "Use Prepared Statement" toggle on and off in the same query. Specifically, I need to check for a column value that is null, which requires the "Use Prepared Statement" toggle to be off. Adding quotes around the storeValue condition seems to have solved the issue.
Resolution
The user was trying to write a MySQL query that checks for an equality condition with the appsmith parameter - appsmith.store.currentStateName in the WHERE clause, where currentStateName is set in a javacript function. The query required the "Use Prepared Statement" toggle to be set as ON, but also needed to check for a NULL condition in a column value which requires the "Use Prepared Statement" toggle to be set as OFF. To achieve both conditions in a single query in Appsmith, the solution was to put the storeValue condition in quotes and to try turning off the Use Prepared Statement option if the quotes did not work.
The final working query looked like this:
select * from table WHERE field1.CurrentState = '{{ appsmith.store?.currentStateName}}' AND field2 IS NULL