The below statement functions fine in a mapserver query:
query.where = "STRU_NAME = '" + structure+ "'";
I'd like to switch the " = " to a like statement. I can't seem to get this statement to return any data:
query.where = "STRU_NAME like '" + structure+"'";
Any suggestions? I'm fairly new to development, probably something easy.
Solved! Go to Solution.
Thanks Robert. I had tried similar syntax changes like you mention but still have no luck, no data gets returned.
Here is the URL (part of it) that with the modification you mention:
This is the original (=, returns data on exact match).
Looks good to me, not sure where the hangup is.
Some time ago I asked a similar question and I am guessing the same answer applies to you.
Statements with LIKE operator are not standardized queries and they are disabled in 10.2+ by default.
Hope this explains the issues you are having.
Thanks for the tip, I'll check this out when I have a moment.
One last question... if I were to want to add an AND clause to this could you point me in the right direction?
query.where = "STRU_NAME like '" + stateName+ "%' and BMP_TYPE like '" + bmpType+ "%'";