<?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 mapservice layer with definition query fails to execute query on rest site in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79767#M369</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using ArcGIS 10.3.1 to create and publish mapservices.&amp;nbsp; I have an Oracle SDE layer with the following definition query: IS_DISPLAYED = 1 ORDER BY ISSUED_DATE ASC.&amp;nbsp; The expression is successfully verified and displays the correct data in the mxd.&amp;nbsp; When I publish the mapservice containing this layer as a service, and try to do a query operation from the REST site on this layer, I get the following error: "Failed to execute query."&amp;nbsp; When I remove the definition query from the layer and re-publish the service, the query works just fine from the REST site.&amp;nbsp; Is ArcGIS for Server unable to process this type of definition query through the mapservice?&amp;nbsp; Is there a different definition query I should use instead to get the same results?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Sep 2016 00:05:15 GMT</pubDate>
    <dc:creator>BethannMcVicker</dc:creator>
    <dc:date>2016-09-24T00:05:15Z</dc:date>
    <item>
      <title>mapservice layer with definition query fails to execute query on rest site</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79767#M369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using ArcGIS 10.3.1 to create and publish mapservices.&amp;nbsp; I have an Oracle SDE layer with the following definition query: IS_DISPLAYED = 1 ORDER BY ISSUED_DATE ASC.&amp;nbsp; The expression is successfully verified and displays the correct data in the mxd.&amp;nbsp; When I publish the mapservice containing this layer as a service, and try to do a query operation from the REST site on this layer, I get the following error: "Failed to execute query."&amp;nbsp; When I remove the definition query from the layer and re-publish the service, the query works just fine from the REST site.&amp;nbsp; Is ArcGIS for Server unable to process this type of definition query through the mapservice?&amp;nbsp; Is there a different definition query I should use instead to get the same results?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Sep 2016 00:05:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79767#M369</guid>
      <dc:creator>BethannMcVicker</dc:creator>
      <dc:date>2016-09-24T00:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: mapservice layer with definition query fails to execute query on rest site</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79768#M370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bethann,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exert for the ArcGIS Desktop help:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Building a query expression&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;Because you are selecting columns as a whole, you cannot restrict the SELECT to return only some of the columns in the corresponding table because the SELECT * syntax is hard-coded. For this reason, keywords, such as DISTINCT, ORDER BY, and GROUP BY, cannot be used in an SQL query in ArcGIS except when using subqueries. See &lt;A _jive_internal="true" class="" href="https://community.esri.com/thread/00s500000033000000.htm"&gt;SQL reference for query expressions used in ArcGIS&lt;/A&gt; for information on subqueries.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Sep 2016 22:03:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79768#M370</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-09-24T22:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: mapservice layer with definition query fails to execute query on rest site</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79769#M371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the info.&amp;nbsp; Do you know of a standardized query alternative for the query i'm using?&amp;nbsp; I looked at the article but didn't see anything that could be substituted for ORDER BY.&amp;nbsp; If not, I may try disabling standardized queries on my AGS to see if that fixes the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 19:23:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79769#M371</guid>
      <dc:creator>BethannMcVicker</dc:creator>
      <dc:date>2016-09-26T19:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: mapservice layer with definition query fails to execute query on rest site</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79770#M372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bethann,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;The work of sorting the results is to be done my the client code that consumes the REST endpoint of the Map Service. For example if using the JS API the Query Class has a&amp;nbsp;orderByFields property that can be set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 19:31:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79770#M372</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-09-26T19:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: mapservice layer with definition query fails to execute query on rest site</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79771#M373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apart from expression Check for map services capabilities&lt;/P&gt;&lt;P&gt;is you have enabled query option on this service or not?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2016 10:21:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/mapservice-layer-with-definition-query-fails-to/m-p/79771#M373</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-09-27T10:21:18Z</dc:date>
    </item>
  </channel>
</rss>

