The New Map Viewer does not handle underscore correctly in a filter. It seems to do nothing. Looks like maybe escape was not programmed in? I just checked and the classic viewer does not work either.
In Python it is
whereClause = "RecKey LIKE '%$_' ESCAPE '$' Or RecKey LIKE '$_%' ESCAPE '$'"
Is there a way to use escape or similar?
thanks
Solved! Go to Solution.
Try using brackets to escape wildcards. It appears your guess is right, ESCAPE doesn't really do anything.
Here's a feature w/ an underscore.
Filtering for "contains _":
(For the record, those other features do not have underscores.)
Filtering for "contains [_]":
Try using brackets to escape wildcards. It appears your guess is right, ESCAPE doesn't really do anything.
Here's a feature w/ an underscore.
Filtering for "contains _":
(For the record, those other features do not have underscores.)
Filtering for "contains [_]":
Well that worked. Where did you find that? Is it documented?
Thanks
I've no idea if it's documented in the ESRI-verse anywhere, but I had to do a similar filter once and saw this in the MS SQL docs: https://docs.microsoft.com/en-us/sql/t-sql/language-elements/like-transact-sql?view=sql-server-ver15...
I did not even try it since [] does not work on a GDB. I have found the SQL to be slightly diff for each place in Arc, which is a major pain. I found things like CAST works on a GDB but not a in_memory set. https://community.esri.com/t5/data-management-questions/using-sql-cast-functionality-in-against-a-fi...
Wish it was all consistent. Thanks