<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: QUERYTASK and case sensitivity in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54976#M4842</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;query.where ="Upper(STATE_NAME) like '%" + stateName.toUpperCase() +"'%";&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to add to this - using Upper() in the query seems to slow it down dramatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found it &lt;/SPAN&gt;&lt;STRONG&gt;much&lt;/STRONG&gt;&lt;SPAN&gt; faster to convert the values to uppercase in the geodatabase (in an edit session within ArcMap), and simply use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
query.where ="STATE_NAME like '%" + stateName.toUpperCase() +"'%";
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 22:05:37 GMT</pubDate>
    <dc:creator>StephenLead</dc:creator>
    <dc:date>2021-12-10T22:05:37Z</dc:date>
    <item>
      <title>QUERYTASK and case sensitivity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54973#M4839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What are the techniques recommended for handling case sensitivity in a query in the JS API?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/query_nomap.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Query No Map&lt;/A&gt;&lt;SPAN&gt; sample is a perfect example - search on "CALIFORNIA" and it returns no results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to handle the situation where the user doesn't know the correct capitalisation required?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function execute(stateName) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.text = stateName;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,showResults);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could convert query.text to upper- or lower-case, but that doesn't help unless the actual value in the geodatabase matches. Is there a flag to ignore the case in a query?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:05:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54973#M4839</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2021-12-10T22:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: QUERYTASK and case sensitivity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54974#M4840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What are the techniques recommended for handling case sensitivity in a query in the JS API?&lt;BR /&gt;&lt;BR /&gt;The &lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/query_nomap.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Query No Map&lt;/A&gt; sample is a perfect example - search on "CALIFORNIA" and it returns no results.&lt;BR /&gt;&lt;BR /&gt;Is there a way to handle the situation where the user doesn't know the correct capitalisation required?&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function execute(stateName) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.text = stateName;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,showResults);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;You could convert query.text to upper- or lower-case, but that doesn't help unless the actual value in the geodatabase matches. Is there a flag to ignore the case in a query?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Steve&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;query.text, as API stated, is "Shorthand for a where clause using "like". The field used is the display field defined in the map document. You can determine what the display field is for a layer in Services Directory".&amp;nbsp; Use query.where instead so that you could convert both end to upper case:&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function execute(stateName) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where ="Upper(STATE_NAME) like '%" + stateName.toUpperCase() +"'%";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query,showResults);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:05:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54974#M4840</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2021-12-10T22:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: QUERYTASK and case sensitivity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54975#M4841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;query.where ="Upper(STATE_NAME) like '%" + stateName.toUpperCase() +"'%";&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That works - thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2011 00:19:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54975#M4841</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2011-08-02T00:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: QUERYTASK and case sensitivity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54976#M4842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;query.where ="Upper(STATE_NAME) like '%" + stateName.toUpperCase() +"'%";&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to add to this - using Upper() in the query seems to slow it down dramatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found it &lt;/SPAN&gt;&lt;STRONG&gt;much&lt;/STRONG&gt;&lt;SPAN&gt; faster to convert the values to uppercase in the geodatabase (in an edit session within ArcMap), and simply use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
query.where ="STATE_NAME like '%" + stateName.toUpperCase() +"'%";
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:05:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54976#M4842</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2021-12-10T22:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: QUERYTASK and case sensitivity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54977#M4843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Just to add to this - using Upper() in the query seems to slow it down dramatically.&lt;BR /&gt;&lt;BR /&gt;I found it &lt;STRONG&gt;much&lt;/STRONG&gt; faster to convert the values to uppercase in the geodatabase (in an edit session within ArcMap), and simply use:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
query.where ="STATE_NAME like '%" + stateName.toUpperCase() +"'%";
&lt;/PRE&gt;&lt;BR /&gt; &lt;BR /&gt;Steve&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Of cause. Basically you eleminate an extra SQL function UPPER().&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:05:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54977#M4843</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2021-12-10T22:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: QUERYTASK and case sensitivity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54978#M4844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How would you write this if you wanted to query using a second attribute as well?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 17:52:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54978#M4844</guid>
      <dc:creator>KennethRichards</dc:creator>
      <dc:date>2013-09-09T17:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: QUERYTASK and case sensitivity</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54979#M4845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;How would you write this if you wanted to query using a second attribute as well?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could use something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

query.where ="STATE_NAME like '%" + stateName.toUpperCase() +"'% AND SECOND_ATTRIBUTE like %" + secondValue.toUpperCase() + "%"
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(I haven't verified that it all balances out, but the key thing is to use an AND statement in the URL query).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:05:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-and-case-sensitivity/m-p/54979#M4845</guid>
      <dc:creator>StephenLead</dc:creator>
      <dc:date>2021-12-10T22:05:42Z</dc:date>
    </item>
  </channel>
</rss>

