ArcGIS Server query

6292
11
Jump to solution
08-26-2015 10:58 AM
ShaningYu
Frequent Contributor

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.

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

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%'

View solution in original post

11 Replies
ChrisSergent
Regular Contributor III

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.

0 Kudos
ShaningYu
Frequent Contributor

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.

0 Kudos
ChrisSergent
Regular Contributor III

Is your feature service public? And do you have an example expression that you are trying?

0 Kudos
ShaningYu
Frequent Contributor

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.

0 Kudos
KenBuja
MVP Esteemed Contributor

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%'

ShaningYu
Frequent Contributor

Tested like upper(NAME) LIKE upper('b04') in ArcGIS Server successfully.  Thanks.

0 Kudos
TanuHoque
Esri Regular Contributor

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.

ShaningYu
Frequent Contributor

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.

0 Kudos
TanuHoque
Esri Regular Contributor

the link you put in your reply takes brings me back to this thread... can you please check the link?

0 Kudos