Query doesnt return results if i dont use caps

497
2
Jump to solution
09-10-2012 01:47 AM
MatejSkerjanc
Occasional Contributor
I got a query widget and if i dont enter the search string in upper case it wont return results but will trigger an error.
I have almost identical application just different service and it works with lower case without a problem.
Is there something i'm missing?
0 Kudos
1 Solution

Accepted Solutions
StephenLead
Regular Contributor III
if i dont enter the search string in upper case it wont return results but will trigger an error.
I have almost identical application just different service and it works with lower case without a problem.


It's likely that in one service, your values are stored in uppercase while in the other service, they are stored in lowercase. The query honours the case of the input features.

To test this, open your query URL in a web browser and append "/query" - this will bring up an interface allowing you to inspect the values of your fields. Eg:

http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/Since_1970/MapServer/0/query

For example, this query reveals that the Name field is stored in uppercase:

 "Name" : "CHINA: YUNNAN PROVINCE; VIETNAM: HANOI"


You may be able to handle this in your code by converting the input string and the query to uppercase.

View solution in original post

0 Kudos
2 Replies
StephenLead
Regular Contributor III
if i dont enter the search string in upper case it wont return results but will trigger an error.
I have almost identical application just different service and it works with lower case without a problem.


It's likely that in one service, your values are stored in uppercase while in the other service, they are stored in lowercase. The query honours the case of the input features.

To test this, open your query URL in a web browser and append "/query" - this will bring up an interface allowing you to inspect the values of your fields. Eg:

http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/Since_1970/MapServer/0/query

For example, this query reveals that the Name field is stored in uppercase:

 "Name" : "CHINA: YUNNAN PROVINCE; VIETNAM: HANOI"


You may be able to handle this in your code by converting the input string and the query to uppercase.
0 Kudos
MatejSkerjanc
Occasional Contributor
It's likely that in one service, your values are stored in uppercase while in the other service, they are stored in lowercase. The query honours the case of the input features.

To test this, open your query URL in a web browser and append "/query" - this will bring up an interface allowing you to inspect the values of your fields. Eg:

http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/Since_1970/MapServer/0/query

For example, this query reveals that the Name field is stored in uppercase:

 "Name" : "CHINA: YUNNAN PROVINCE; VIETNAM: HANOI"


You may be able to handle this in your code by converting the input string and the query to uppercase.


It was me thinking it works like usual SQL server where it doesnt really matter if you type in lower case or upper case but i solved it using setting query task where to use LOWER. Thanks for the answer!
0 Kudos