I tested a query on a FC in ArcMap and the published mapservice layer in ArcGIS Server simultaneously. In ArcMap, the query is not case-sensitive. However, it is case sensitive in ArcGIS Server. Is there a way to set the query case-insensitive in the published service layer? Thanks.
Solved! Go to Solution.
You can search using Upper (or Lower) when querying a service. You have make sure what you're querying is in the expected case.
For example, I have a field name Comments that contains strings like "Coral" and "coral".
Both of these statements returns all expected records:
lower(Comments) like '%coral%'
upper(Comments) like '%CORAL%'
but this doesn't return any records
lower(Comments) like '%Coral%'
What is FC? And how are you trying to run the query in against the published service layer? Is it JavaScript? If so, you can use UCase in JavaScript to convert values to uppercase so that they match.
FC = feature class. This FC is published as a mapservice layer. I'm using ESRI cmv project template. The serach function provided in that project is case-sensitive. I also posted a thread there: https://community.esri.com/message/546455#546455
Besides I also tested the query string: Upper(FName) like 'theValue'. It does not work.
Is your feature service public? And do you have an example expression that you are trying?
Not public. I tested the query string:
(Upper)MON_TYPE LIKE 'theValue'
and
MON_TYPE LIKE Upper('theValue')
but neither works (see Search Tool - Case sensitive ). Thanks.
You can search using Upper (or Lower) when querying a service. You have make sure what you're querying is in the expected case.
For example, I have a field name Comments that contains strings like "Coral" and "coral".
Both of these statements returns all expected records:
lower(Comments) like '%coral%'
upper(Comments) like '%CORAL%'
but this doesn't return any records
lower(Comments) like '%Coral%'
Tested like upper(NAME) LIKE upper('b04') in ArcGIS Server successfully. Thanks.
FYI: case sensitivity in query depends on the underlying database and its settings. Clients like ArcMap or ArcGIS Server simply passes the sql where-clause to the underline database....
are you publishing by copying data on to the server and in that process the data gets copied to a different type of database? that may explain why it works in ArcMap but not on ArcGIS Server.
It is OK on ArcGIS Server query. My real prolem is in https://community.esri.com/message/546456#546456 I haven't found the solution for the query string in CMV JS application. Thanks.
the link you put in your reply takes brings me back to this thread... can you please check the link?