<?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: arcgis.features.FeatureLayer.query() method returns Database error (500) in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-features-featurelayer-query-method-returns/m-p/812199#M2508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Thank you for your reply!&lt;/P&gt;&lt;P&gt;These are the Server logs for the error generated:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #505051; background-color: #ffffff; border: none; font-size: 12px;"&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="font-size: 12px; width: 557px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px; width: 49px;"&gt;SEVERE&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px; width: 142px;"&gt;Nov 13, 2017, 8:26:37 PM&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px; width: 299px;"&gt;Database error has occurred.&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px; width: 25px;"&gt;Rest&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #505051; background-color: #ffffff; border: none; font-size: 12px;"&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="font-size: 12px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px;"&gt;SEVERE&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px;"&gt;Nov 13, 2017, 8:26:37 PM&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px;"&gt;0 : ERROR: column "Mixed" does not exist Position: &lt;STRONG&gt;132&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px;"&gt;Rest&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;It seems like the query is treating "Mixed" as a column (though I do not know why it would)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I changed the query as:&lt;/P&gt;&lt;P&gt;mmig_fl.query(where='"Mixed" LIKE "cause_of_death"', &lt;BR /&gt; return_count_only=True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still the error persists (you can see the change in the position from 132 to 112):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #505051; background-color: #ffffff; border: none; font-size: 12px;"&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="font-size: 12px; width: 555px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="" colspan="1" style="background: #e5edf4; border-width: 1px; border-style: solid; border-color: #769dc0 #e5dac8 #769dc0 transparent; padding: 3px 5px; width: 49px;"&gt;SEVERE&lt;/TD&gt;&lt;TD class="" colspan="1" style="background: #e5edf4; border-width: 1px; border-style: solid; border-color: #769dc0 #e5dac8 #769dc0 transparent; padding: 3px 5px; width: 143px;"&gt;Nov 13, 2017, 8:27:18 PM&lt;/TD&gt;&lt;TD class="" colspan="1" style="background: #e5edf4; border-width: 1px; border-style: solid; border-color: #769dc0 #e5dac8 #769dc0 transparent; padding: 3px 5px; width: 297px;"&gt;Database error has occurred.&lt;/TD&gt;&lt;TD class="" colspan="1" style="background: #e5edf4; border-width: 1px; border-style: solid; border-color: #769dc0 #e5dac8 #769dc0 transparent; padding: 3px 5px; width: 24px;"&gt;Rest&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #505051; background-color: #ffffff; border: none; font-size: 12px;"&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="font-size: 12px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: #bfd6eb #e5dac8 #bfd6eb transparent; padding: 3px 5px;"&gt;SEVERE&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: #bfd6eb #e5dac8 #bfd6eb transparent; padding: 3px 5px;"&gt;Nov 13, 2017, 8:27:18 PM&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: #bfd6eb #e5dac8 #bfd6eb transparent; padding: 3px 5px;"&gt;0 : ERROR: column "Mixed" does not exist Position: &lt;STRONG&gt;112&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: #bfd6eb #e5dac8 #bfd6eb transparent; padding: 3px 5px;"&gt;Rest&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What could cause this error? I do not think I am messing with the SQL Query. But, somehow, it is misinterpreted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(P.S. - I assume the SQL Query syntax in ArcGIS API for Python is same as that of ArcGIS Desktop. If not, is there a reference&amp;nbsp;you can point me to?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Lakshmi Kanthan M.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Nov 2017 15:19:25 GMT</pubDate>
    <dc:creator>Lakshmi_KanthanMuralikrishnan</dc:creator>
    <dc:date>2017-11-13T15:19:25Z</dc:date>
    <item>
      <title>arcgis.features.FeatureLayer.query() method returns Database error (500)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-features-featurelayer-query-method-returns/m-p/812197#M2506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I've been exploring &lt;STRONG&gt;ArcGIS API for Python&lt;/STRONG&gt;. Currently, I am working on&amp;nbsp;&lt;EM&gt;querying&lt;/EM&gt; a feature layer using the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: square;"&gt;&lt;LI&gt;&lt;STRONG&gt;Some Background: &lt;/STRONG&gt;(on the feature layer queried)&lt;UL&gt;&lt;LI&gt;The&amp;nbsp;data was added in the Portal as&amp;nbsp;an 'Item'&amp;nbsp;using the &lt;STRONG&gt;arcgis.gis.GIS.content.add()&lt;/STRONG&gt; method from a CSV file.&lt;/LI&gt;&lt;LI&gt;Then, the item was published using the &lt;STRONG&gt;arcgis.gis.GIS.Item.publish()&lt;/STRONG&gt; method.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;IMG alt="The CSV file and the hosted feature layer" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/381868_ArcGISAPIforPy_DBError_1.png" style="width: 620px; height: 41px;" /&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;STRONG&gt;Feature Layer Info: &lt;/STRONG&gt;(from the hosted service)&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;H2 style="font-weight: bold; font-size: 1.2em; padding-left: 60px;" id="toc-hId-1817340406"&gt;Layer: miss_mig_date_clean (ID: 0)&lt;/H2&gt;&lt;P style="padding-left: 60px;"&gt;&lt;STRONG style="color: #000000; background-color: #ffffff; font-size: 14.4px;"&gt;Fields:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;objectid&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeOID , alias: objectid , nullable: false , editable: false )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;id&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeInteger , alias: id , editable: true , nullable: true )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;cause_of_death&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeString , alias: cause_of_death , editable: true , nullable: true , length: 8000 )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;region_origin&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeString , alias: region_origin , editable: true , nullable: true , length: 8000 )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;affected_nationality&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeString , alias: affected_nationality , editable: true , nullable: true , length: 8000 )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;missing&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeInteger , alias: missing , editable: true , nullable: true )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;dead&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeInteger , alias: dead , editable: true , nullable: true )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;incident_region&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeString , alias: incident_region , editable: true , nullable: true , length: 8000 )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;date_&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeDate , alias: date , editable: true , nullable: true , length: 29 )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;source&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeString , alias: source , editable: true , nullable: true , length: 8000 )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;reliability&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeString , alias: reliability , editable: true , nullable: true , length: 8000 )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;lat&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeDouble , alias: lat , editable: true , nullable: true )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;lon&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;( type: esriFieldTypeDouble , alias: lon , editable: true , nullable: true )&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;IMG alt="A snippet of the feature layer table from Portal for ArcGIS" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/381867_ArcGISAPIforPy_DBError.png" style="width: 620px; height: 152px;" /&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;EM&gt;A snippet of the feature layer table from Portal for ArcGIS&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I am trying to execute the following query against this feature layer:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;EM&gt;#mmig_fl is&amp;nbsp;a&amp;nbsp;arcgis.features.layer.FeatureLayer object&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;mmig_fl.&lt;STRONG style="color: #3366ff;"&gt;query&lt;/STRONG&gt;(where=&lt;SPAN style="color: #ff0000;"&gt;'cause_of_death LIKE Mixed'&lt;/SPAN&gt;, &lt;BR /&gt; return_count_only=&lt;STRONG style="color: #339966;"&gt;True&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The query returns a Database Error as:&lt;/LI&gt;&lt;/UL&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;---------------------------------------------------------------------------&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;RuntimeError&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Traceback (most recent call last)&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;&amp;lt;ipython-input-104-5e79550b0106&amp;gt;&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;&amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;()&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/SPAN&gt; mmig_qr_syria = mmig_fl.query(where='cause_of_death LIKE Mixed', &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;----&amp;gt; 4&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return_count_only=True)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/SPAN&gt; mmig_qr_syria &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;D:\Anaconda3\envs\AGISAPIPy\lib\site-packages\arcgis\features\layer.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;query&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, where, out_fields, time_filter, geometry_filter, return_geometry, return_count_only, return_ids_only, return_distinct_values, return_extent_only, group_by_fields_for_statistics, statistic_filter, result_offset, result_record_count, object_ids, distance, units, max_allowable_offset, out_sr, geometry_precision, gdb_version, order_by_fields, out_statistics, return_z, return_m, multipatch_option, quanitization_parameters, return_centroid, return_all_records, **kwargs)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 388&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 389&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;not&lt;/SPAN&gt; return_all_records&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 390&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;return&lt;/SPAN&gt; self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_query&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;url&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; params&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 391&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 392&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; params&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;'returnCountOnly'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;True&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;D:\Anaconda3\envs\AGISAPIPy\lib\site-packages\arcgis\features\layer.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;_query&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, url, params)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 818&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;""" returns results of query """&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 819&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = self._con.post(path=url,&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;--&amp;gt; 820&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; postdata=params, token=self._token)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 821&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;if&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;'error'&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;in&lt;/SPAN&gt; result&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 822&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;raise&lt;/SPAN&gt; ValueError&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;result&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;D:\Anaconda3\envs\AGISAPIPy\lib\site-packages\arcgis\_impl\connection.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;post&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, path, postdata, files, ssl, compress, is_retry, use_ordered_dict, add_token, verify_cert, token, try_json, out_folder, file_name, force_bytes, add_headers)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp; 1127&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;elif&lt;/SPAN&gt; errorcode &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;==&lt;/SPAN&gt; &lt;SPAN class="" style="color: #258f8f; font-weight: bold;"&gt;498&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp; 1128&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;raise&lt;/SPAN&gt; RuntimeError&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;'Invalid token'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;-&amp;gt; 1129&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;self&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;_handle_json_error&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;resp_json&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;'error'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;]&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;,&lt;/SPAN&gt; errorcode&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp; 1130&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;return&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;None&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp; 1131&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;except&lt;/SPAN&gt; AttributeError&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;D:\Anaconda3\envs\AGISAPIPy\lib\site-packages\arcgis\_impl\connection.py&lt;/SPAN&gt; in &lt;SPAN class="" style="color: #60c6c8;"&gt;_handle_json_error&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;(self, error, errorcode)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp; 1147&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp; 1148&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; errormessage &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;=&lt;/SPAN&gt; errormessage &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;+&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;"\n(Error Code: "&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;+&lt;/SPAN&gt; str&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;errorcode&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt; &lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="" style="color: #0065ca; font-weight: bold;"&gt;")"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;-&amp;gt; 1149&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;raise&lt;/SPAN&gt; RuntimeError&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;errormessage&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp; 1150&lt;/SPAN&gt; &lt;SPAN class="" style="color: #00a250;"&gt;&amp;nbsp;&amp;nbsp; 1151&lt;/SPAN&gt; &lt;SPAN class="" style="color: #007427; font-weight: bold;"&gt;class&lt;/SPAN&gt; _StrictURLopener&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;(&lt;/SPAN&gt;request&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;.&lt;/SPAN&gt;FancyURLopener&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b27d12; font-weight: bold;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;RuntimeError&lt;/SPAN&gt;: Database error has occurred. (Error Code: 500)&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #b22b31; font-weight: bold;"&gt;---------------------------------------------------------------------------

&lt;/SPAN&gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;I've also tried the query quoting the string literal used in comparison -&amp;nbsp;&lt;SPAN&gt;mmig_fl.&lt;/SPAN&gt;&lt;STRONG style="color: #3366ff;"&gt;query&lt;/STRONG&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;where=&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;'cause_of_death LIKE "Mixed"'&lt;/SPAN&gt;&lt;SPAN&gt;, ...), but end up with the same.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'd like to know what could possibly cause this error. Please let me know if more details are required from my end!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;##&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;FYI&lt;/STRONG&gt;: &lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;I've tried the query with simple numeric queries like (where=&lt;SPAN style="color: #ff0000;"&gt;'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;SPAN style="color: #ff0000;"&gt;dead&amp;gt;=100'&lt;/SPAN&gt;, ...) and &lt;STRONG&gt;it works&lt;/STRONG&gt;!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff; color: #000000;"&gt;When there was an error in the where keyword-argument value, suitable error was raised. So, I think this could be ruled out.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff; color: #000000;"&gt;The Feature Layer was read with necessary authentication (using gis=&amp;lt;current_gis_instance_which_has_access_to_data&amp;gt; argument in the arcgis.features.FeatureLayer() method).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #000000;"&gt;Thanks for your time and attention!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:33:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-features-featurelayer-query-method-returns/m-p/812197#M2506</guid>
      <dc:creator>Lakshmi_KanthanMuralikrishnan</dc:creator>
      <dc:date>2021-12-12T09:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.features.FeatureLayer.query() method returns Database error (500)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-features-featurelayer-query-method-returns/m-p/812198#M2507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This query would work to return a count of features with the cause_of_death attribute value of Mixed:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;mmig_fl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;query&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;where&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"cause_of_death LIKE 'Mixed'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; return_count_only&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The 500 HTTP error code means the server couldn't process the request for some reason. Do your Server logs have any more detailed information from when the error occurred?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How many features are returned when you run that where clause in the query dialog on the rest endpoint of the hosted feature layer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 19:24:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-features-featurelayer-query-method-returns/m-p/812198#M2507</guid>
      <dc:creator>JohnYaist1</dc:creator>
      <dc:date>2017-11-08T19:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.features.FeatureLayer.query() method returns Database error (500)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-features-featurelayer-query-method-returns/m-p/812199#M2508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;Thank you for your reply!&lt;/P&gt;&lt;P&gt;These are the Server logs for the error generated:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #505051; background-color: #ffffff; border: none; font-size: 12px;"&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="font-size: 12px; width: 557px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px; width: 49px;"&gt;SEVERE&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px; width: 142px;"&gt;Nov 13, 2017, 8:26:37 PM&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px; width: 299px;"&gt;Database error has occurred.&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px; width: 25px;"&gt;Rest&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #505051; background-color: #ffffff; border: none; font-size: 12px;"&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="font-size: 12px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px;"&gt;SEVERE&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px;"&gt;Nov 13, 2017, 8:26:37 PM&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px;"&gt;0 : ERROR: column "Mixed" does not exist Position: &lt;STRONG&gt;132&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: transparent #e5dac8 #e5dac8 transparent; padding: 3px 5px;"&gt;Rest&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;It seems like the query is treating "Mixed" as a column (though I do not know why it would)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I changed the query as:&lt;/P&gt;&lt;P&gt;mmig_fl.query(where='"Mixed" LIKE "cause_of_death"', &lt;BR /&gt; return_count_only=True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still the error persists (you can see the change in the position from 132 to 112):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #505051; background-color: #ffffff; border: none; font-size: 12px;"&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="font-size: 12px; width: 555px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="" colspan="1" style="background: #e5edf4; border-width: 1px; border-style: solid; border-color: #769dc0 #e5dac8 #769dc0 transparent; padding: 3px 5px; width: 49px;"&gt;SEVERE&lt;/TD&gt;&lt;TD class="" colspan="1" style="background: #e5edf4; border-width: 1px; border-style: solid; border-color: #769dc0 #e5dac8 #769dc0 transparent; padding: 3px 5px; width: 143px;"&gt;Nov 13, 2017, 8:27:18 PM&lt;/TD&gt;&lt;TD class="" colspan="1" style="background: #e5edf4; border-width: 1px; border-style: solid; border-color: #769dc0 #e5dac8 #769dc0 transparent; padding: 3px 5px; width: 297px;"&gt;Database error has occurred.&lt;/TD&gt;&lt;TD class="" colspan="1" style="background: #e5edf4; border-width: 1px; border-style: solid; border-color: #769dc0 #e5dac8 #769dc0 transparent; padding: 3px 5px; width: 24px;"&gt;Rest&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #505051; background-color: #ffffff; border: none; font-size: 12px;"&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="font-size: 12px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: #bfd6eb #e5dac8 #bfd6eb transparent; padding: 3px 5px;"&gt;SEVERE&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: #bfd6eb #e5dac8 #bfd6eb transparent; padding: 3px 5px;"&gt;Nov 13, 2017, 8:27:18 PM&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: #bfd6eb #e5dac8 #bfd6eb transparent; padding: 3px 5px;"&gt;0 : ERROR: column "Mixed" does not exist Position: &lt;STRONG&gt;112&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="" colspan="1" style="border-width: 1px; border-style: solid; border-color: #bfd6eb #e5dac8 #bfd6eb transparent; padding: 3px 5px;"&gt;Rest&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What could cause this error? I do not think I am messing with the SQL Query. But, somehow, it is misinterpreted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(P.S. - I assume the SQL Query syntax in ArcGIS API for Python is same as that of ArcGIS Desktop. If not, is there a reference&amp;nbsp;you can point me to?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Lakshmi Kanthan M.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 15:19:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-features-featurelayer-query-method-returns/m-p/812199#M2508</guid>
      <dc:creator>Lakshmi_KanthanMuralikrishnan</dc:creator>
      <dc:date>2017-11-13T15:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: arcgis.features.FeatureLayer.query() method returns Database error (500)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-features-featurelayer-query-method-returns/m-p/812200#M2509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/298547"&gt;Lakshmi&lt;/A&gt;&amp;nbsp;- Ok. So Let's try a query from the API just to make sure that we're getting results. Try this:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;mmig_fl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;query&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;where&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1=1"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; return_count_only&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Does that return the expected number of features?&amp;nbsp; Can you also try to run the query from the where clause on the rest endpoint of the layer? What results do you get from that?&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know what you find out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 00:38:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcgis-features-featurelayer-query-method-returns/m-p/812200#M2509</guid>
      <dc:creator>JohnYaist1</dc:creator>
      <dc:date>2018-01-04T00:38:33Z</dc:date>
    </item>
  </channel>
</rss>

