<?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: SQL query 10.9 not working in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/sql-query-10-9-not-working/m-p/1118831#M4016</link>
    <description>&lt;P&gt;Personally, if I've got a lot of attributes to sift through, I just bring the entire field into a pandas dataframe and use regular expressions. It's much easier to define a really precise, adaptable regex expression than wrangle the SQL into submission.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Nov 2021 19:38:01 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-11-19T19:38:01Z</dc:date>
    <item>
      <title>SQL query 10.9 not working</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/sql-query-10-9-not-working/m-p/1118758#M4013</link>
      <description>&lt;P&gt;According to the documentation as of 10.9, hosted feature services support SQL statements.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer-.htm" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer-.html&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Hosted feature services on a relational data store support SQL expression for the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;outFields&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;parameter when&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;supportsOutFieldSqlExpression&lt;/SPAN&gt;, under&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;advancedQueryCapabilities&lt;/SPAN&gt;, is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;true&lt;/SPAN&gt;. Hosted feature services in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;ArcGIS Online&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;already support this functionality.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If specifying outFields as expressions on a feature service-based&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html" target="_blank" rel="noopener"&gt;FeatureLayer&lt;/A&gt;, the service capabilities&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;advancedQueryCapabilities.supportsOutFieldSQLExpression&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;useStandardizedQueries&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;must both be true.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;But a very simply expression does not work.&amp;nbsp;&amp;nbsp;PartyName LIKE '%driscoll%',&lt;/P&gt;&lt;P&gt;on this layer:&amp;nbsp;&lt;A href="https://www.jfksgis.us/server/rest/services/Hosted/Parcel_hosted/FeatureServer/0/query" target="_blank" rel="noopener"&gt;https://www.jfksgis.us/server/rest/services/Hosted/Parcel_hosted/FeatureServer/0/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The SQL query works fine in Pro and for Online services:&amp;nbsp;&lt;A href="https://services1.arcgis.com/tpr1e2h7Rmn9C5oc/ArcGIS/rest/services/JFKS_GIS_ParcelOrion_Public_V4/FeatureServer/0" target="_blank" rel="noopener"&gt;https://services1.arcgis.com/tpr1e2h7Rmn9C5oc/ArcGIS/rest/services/JFKS_GIS_ParcelOrion_Public_V4/FeatureServer/0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So is this not actually supported in server 10.9?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 17:12:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/sql-query-10-9-not-working/m-p/1118758#M4013</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2021-11-19T17:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query 10.9 not working</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/sql-query-10-9-not-working/m-p/1118823#M4014</link>
      <description>&lt;P&gt;Seems to work just fine, but keep in mind that these queries are two different things:&lt;/P&gt;&lt;PRE&gt;PartyName LIKE '%driscoll%'&lt;BR /&gt;PartyName LIKE '%Driscoll%'&lt;/PRE&gt;&lt;P&gt;Unfortunately, we can't use ILIKE to ignore the case of the input string. Using a bracketed set of characters, like "[Dd]riscoll" doesn't appear to work here either. I guess you'd have to combine two queries and put an OR between them.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1637349734741.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/27940i2887F7555AD5BB8E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1637349734741.png" alt="jcarlson_0-1637349734741.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 19:22:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/sql-query-10-9-not-working/m-p/1118823#M4014</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-11-19T19:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query 10.9 not working</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/sql-query-10-9-not-working/m-p/1118830#M4015</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; This is a simplified problem, I have many attributes I need to query.&amp;nbsp; ESRI is logging it as an enhancement instead of a bug, even though it is a basic very simple sql statement, so it might be a long time until it gets fixed.&amp;nbsp; They need to update their documentation that&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;supportsOutFieldSQLExpression is not supported currently with rest endpoints.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 19:35:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/sql-query-10-9-not-working/m-p/1118830#M4015</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2021-11-19T19:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query 10.9 not working</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/sql-query-10-9-not-working/m-p/1118831#M4016</link>
      <description>&lt;P&gt;Personally, if I've got a lot of attributes to sift through, I just bring the entire field into a pandas dataframe and use regular expressions. It's much easier to define a really precise, adaptable regex expression than wrangle the SQL into submission.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 19:38:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/sql-query-10-9-not-working/m-p/1118831#M4016</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-11-19T19:38:01Z</dc:date>
    </item>
  </channel>
</rss>

