Is it possible to pass the coloumn name also like a variable.Please edit this code.
var columnname=hhSanitHouseType;
var operator = ...;
var textvalue = ...;
layer.setQuery("SELECT 'geometry',hhSanitHouseType FROM " + tableid + " WHERE 'hhSanitHouseType'" + operator + " '" + textvalue + "'");
You seem to ask the same question over and over again.
I already gave you the answer or see the answer of Eric. Or am I missing something?