<?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: SearchCursor sql_clause not working in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/searchcursor-sql-clause-not-working/m-p/1212426#M65560</link>
    <description>&lt;P&gt;I don't think you can use either of those SQL queries against a shapefile (see Example 5a &amp;amp; 6):&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/searchcursor-class.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/searchcursor-class.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;May have better luck using the where_clause with shapefiles.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Sep 2022 13:47:27 GMT</pubDate>
    <dc:creator>dgiersz_cuyahoga</dc:creator>
    <dc:date>2022-09-14T13:47:27Z</dc:date>
    <item>
      <title>SearchCursor sql_clause not working</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-sql-clause-not-working/m-p/1212413#M65558</link>
      <description>&lt;P&gt;I am working with searchcursors for a .shp file with arcpy 3.0-py39. I am unable to get the searchcursor's sql clause to do frankly anything. Regardless of my clause I get the same result (all rows printed to screen, unordered).&lt;/P&gt;&lt;P&gt;For instance both of these provide the same response:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for row in arcpy.da.SearchCursor(in_table="Crashes_in_DC",
              field_names="Tot_PedBik",
              sql_clause=('TOP 3', None)):
        print(f" {row[0]}" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for row in arcpy.da.SearchCursor(in_table="Crashes_in_DC",
              field_names="Tot_PedBik",
              sql_clause=(None, 'ORDER BY Tot_PedBik DESC')):
        print(f" {row[0]}" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 13:29:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-sql-clause-not-working/m-p/1212413#M65558</guid>
      <dc:creator>mmann1123</dc:creator>
      <dc:date>2022-09-14T13:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor sql_clause not working</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-sql-clause-not-working/m-p/1212426#M65560</link>
      <description>&lt;P&gt;I don't think you can use either of those SQL queries against a shapefile (see Example 5a &amp;amp; 6):&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/searchcursor-class.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/searchcursor-class.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;May have better luck using the where_clause with shapefiles.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 13:47:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-sql-clause-not-working/m-p/1212426#M65560</guid>
      <dc:creator>dgiersz_cuyahoga</dc:creator>
      <dc:date>2022-09-14T13:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor sql_clause not working</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-sql-clause-not-working/m-p/1212427#M65561</link>
      <description>&lt;P&gt;Ok I will try that.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 13:49:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-sql-clause-not-working/m-p/1212427#M65561</guid>
      <dc:creator>mmann1123</dc:creator>
      <dc:date>2022-09-14T13:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: SearchCursor sql_clause not working</title>
      <link>https://community.esri.com/t5/python-questions/searchcursor-sql-clause-not-working/m-p/1212430#M65562</link>
      <description>&lt;P&gt;They could at least throw a warning my way though...&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2022 13:54:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/searchcursor-sql-clause-not-working/m-p/1212430#M65562</guid>
      <dc:creator>mmann1123</dc:creator>
      <dc:date>2022-09-14T13:54:34Z</dc:date>
    </item>
  </channel>
</rss>

