<?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 Using a where clause in a search cursor in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-a-where-clause-in-a-search-cursor/m-p/1124584#M63216</link>
    <description>&lt;P&gt;Hello all, I am pretty new to programming and arcpy. I am attaching a code where I am trying to take an input country from a user and use it in the where clause to return a list of the population ranks present for that country. As it is now, it returns an error that a column was specified that does not exist. The issue is in my query, but I cannot figure out how to format it to only return results from a certain country. Don't worry about the 2nd half of the code, as I am just trying to figure out this search cursor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Dec 2021 20:37:22 GMT</pubDate>
    <dc:creator>LoganBohn</dc:creator>
    <dc:date>2021-12-09T20:37:22Z</dc:date>
    <item>
      <title>Using a where clause in a search cursor</title>
      <link>https://community.esri.com/t5/python-questions/using-a-where-clause-in-a-search-cursor/m-p/1124584#M63216</link>
      <description>&lt;P&gt;Hello all, I am pretty new to programming and arcpy. I am attaching a code where I am trying to take an input country from a user and use it in the where clause to return a list of the population ranks present for that country. As it is now, it returns an error that a column was specified that does not exist. The issue is in my query, but I cannot figure out how to format it to only return results from a certain country. Don't worry about the 2nd half of the code, as I am just trying to figure out this search cursor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 20:37:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-where-clause-in-a-search-cursor/m-p/1124584#M63216</guid>
      <dc:creator>LoganBohn</dc:creator>
      <dc:date>2021-12-09T20:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using a where clause in a search cursor</title>
      <link>https://community.esri.com/t5/python-questions/using-a-where-clause-in-a-search-cursor/m-p/1124609#M63218</link>
      <description>&lt;LI-CODE lang="python"&gt;country = 'x'

f'"CNTRY_NAME" = {country}'
'"CNTRY_NAME" = x'&lt;/LI-CODE&gt;&lt;P&gt;perhaps&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 21:20:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-where-clause-in-a-search-cursor/m-p/1124609#M63218</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-09T21:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using a where clause in a search cursor</title>
      <link>https://community.esri.com/t5/python-questions/using-a-where-clause-in-a-search-cursor/m-p/1124617#M63220</link>
      <description>&lt;P&gt;You want the following SQL query:&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;CNTRY_NAME = 'Country'&lt;/LI-CODE&gt;&lt;P&gt;To get that as a string in PYthon:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;query = "CNTRY_NAME = '{}'".format(country)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Dec 2021 21:32:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-where-clause-in-a-search-cursor/m-p/1124617#M63220</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-12-09T21:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using a where clause in a search cursor</title>
      <link>https://community.esri.com/t5/python-questions/using-a-where-clause-in-a-search-cursor/m-p/1124660#M63222</link>
      <description>&lt;P&gt;Thank you so much! I knew it was probably an easy answer but I had been trying to wrap my head around it for hours!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 22:52:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-where-clause-in-a-search-cursor/m-p/1124660#M63222</guid>
      <dc:creator>LoganBohn</dc:creator>
      <dc:date>2021-12-09T22:52:21Z</dc:date>
    </item>
  </channel>
</rss>

