Need two equality condition IS NULL and appsmith.store?.variable in a single where clause in mysql

Hello,

We are trying to write a  mysql query which checks for an equality condition with the appsmith parameter - appsmith.store.currentStateName in the WHERE clause, currentStateName is set in a javacript function.In the query, this requires the "Use Prepared Statement" toggle to be set as ON. Also the mysql keyword  - IS NULL condition has to be checked for a column value which requires the "Use Prepared Statement" toggle to be set as OFF. Can you please suggest how i can achieve both the conditions in a single query in Appsmith

Ex: select * from table WHERE field1.CurrentState = {{ appsmith.store?.currentStateName}} AND field2 IS NULL.

Thanks

@Michael Can you try putting the storeValue condition in quotes like so

select * from table WHERE field1.CurrentState = '{{ appsmith.store?.currentStateName}}' AND field2 IS NULL

And if that does not work, also try turning off Use Prepared Statement

Thanks dancia. Putting Quotes seem to work.