<?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: Search Cursor in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473668#M37003</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2016 20:11:01 GMT</pubDate>
    <dc:creator>MitchHolley1</dc:creator>
    <dc:date>2016-11-18T20:11:01Z</dc:date>
    <item>
      <title>Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473662#M36997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to figure out what the class_field variable is in this query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;fc is the Feature Class&lt;/LI&gt;&lt;LI&gt;Class_field is WHAT?&lt;/LI&gt;&lt;LI&gt;name_field is the field value?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'c:/base/data.gdb/roads'&lt;/SPAN&gt;
class_field &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Road Class'&lt;/SPAN&gt;
name_field &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Name'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create an expression with proper delimiters&lt;/SPAN&gt;
expression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddFieldDelimiters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; name_field&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;' = 2'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create a search cursor using an SQL expression&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;class_field&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; name_field&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&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; where_clause&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;expression&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# Print the name of the residential road&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:56:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473662#M36997</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2021-12-11T20:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473663#M36998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;would it be easier to have a Search Cursor and WHERE clause using sql_clause?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:06:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473663#M36998</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2016-11-18T20:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473664#M36999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please read up on cursors:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/data-access/searchcursor-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/data-access/searchcursor-class.htm"&gt;SearchCursor—Data Access module | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:06:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473664#M36999</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2016-11-18T20:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473665#M37000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to search a FC where 'Field1 = No' or 'Field2 = no'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:07:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473665#M37000</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2016-11-18T20:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473666#M37001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yea thats where I got to example from...what the heck is class_field varaible?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:09:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473666#M37001</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2016-11-18T20:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473667#M37002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ooooh....I think its looking at 2 fields and not 1 is that right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:10:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473667#M37002</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2016-11-18T20:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473668#M37003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:11:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473668#M37003</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2016-11-18T20:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473669#M37004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But what If I wanted classfield=Yes and name_field=No&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:12:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473669#M37004</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2016-11-18T20:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473670#M37005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;good to bookmark ...&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy/what-is-arcpy-.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy/what-is-arcpy-.htm"&gt;What is ArcPy?—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:16:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473670#M37005</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-11-18T20:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473671#M37006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I&amp;nbsp;might be missing something here, but don't you want to print &amp;nbsp;row[0] &amp;nbsp;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:21:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473671#M37006</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-11-18T20:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473672#M37007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this example right from ESRI examples &amp;nbsp;Example 4 here:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/data-access/searchcursor-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/data-access/searchcursor-class.htm"&gt;SearchCursor—Data Access module | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:24:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473672#M37007</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2016-11-18T20:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473673#M37008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to keep reading the documentation for cursors. There's a &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;where_clause&lt;/SPAN&gt; parameter where you can specify that stuff when you create the cursor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:32:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473673#M37008</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2016-11-18T20:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473674#M37009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was just the example I was referencing....I am trying to build a query that will search at a SDE FC Where Field1 = No or FIeld2 = Yes&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:33:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473674#M37009</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2016-11-18T20:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473675#M37010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Prints name of the residential road&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, so the sample us printing the value of the field "Name". &amp;nbsp; I thought you wanted to print out the value of the class_field field (that is the road class field) which should be row[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which field are you wanting to print?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473675#M37010</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-11-18T20:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473676#M37011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you printed out your expression to make sure it is building correctly? &amp;nbsp;Have you tried to test to make sure it works manually and to make sure there are records being returned? &amp;nbsp;Maybe your return set is null/empty?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: btw, it might be better to include the code you are actaully testing v's just a couple of the example in the help. &amp;nbsp;Might be something others can see and test in that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:39:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473676#M37011</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-11-18T20:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473677#M37012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I now started using this example: &amp;nbsp;not sure if I use a WHERE clause or sql_clause....very new to this so please forgive my ignorance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But need to insert a WHERE clause &amp;nbsp;: &amp;nbsp; safteysign = Yes OR regulations = No&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy

arcpy.env.workspace = "C:\\Users\\xxx\\AppData\\Roaming\ESRI\\Desktop10.4\\ArcCatalog\\xxx@xx.sde"

fc = "Inspection"

fields = ['safteysign', 'regulations']

# Use ORDER BY sql clause to sort field values
for row in arcpy.da.SearchCursor(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc, fields, sql_clause=(None, 'regulations')):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print('{0}, {1}'.format(row[0], row[1]))‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:56:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473677#M37012</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2021-12-11T20:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473678#M37013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Example 5B and&amp;nbsp;example 6 in the help documentation show code using the sql_clause parameter. Read the description of the parameters for more detailed information about what each does. Think of a where_clause like a definition query or select by attributes. sql_clause is the extra SQL stuff you can't do in a definition query. In your case, you would just need&amp;nbsp;to use a where_clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:49:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473678#M37013</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2016-11-18T20:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473679#M37014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you want to look at sample 5b, and then take at look at&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm" title="http://pro.arcgis.com/en/pro-app/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm"&gt;SQL reference for query expressions used in ArcGIS—ArcGIS Pro | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp; &amp;nbsp;For getting the SQL query set up correctly. AgainI try to build it in Python and pring it out, but also test to nsi sure it is working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btw, your help doc was pointing to Pro..so mind us too...nit sure if you are using Pro or Desktop, or if the help us much different between the two. Just epwanted to point that out .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 20:52:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473679#M37014</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-11-18T20:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473680#M37015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all very much for the help...&lt;/P&gt;&lt;P&gt;getting confused....Blake saying to use Where Clause in ex 4? &amp;nbsp;and you saying use 5b with sql_clause...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 21:10:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473680#M37015</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2016-11-18T21:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor</title>
      <link>https://community.esri.com/t5/python-questions/search-cursor/m-p/473681#M37016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:\\Users\\xx\\AppData\\Roaming\ESRI\\Desktop10.4\\ArcCatalog\\xx@xx.sde"&lt;/SPAN&gt;

fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Inspection_2"&lt;/SPAN&gt;

class_field &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'regulations'&lt;/SPAN&gt;
name_field &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'region_1'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create an expression with proper delimiters&lt;/SPAN&gt;
expression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; u&lt;SPAN class="string token"&gt;'{} = No'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddFieldDelimiters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; class_field&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Create a search cursor using an SQL expression&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;class_field&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; name_field&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&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; where_clause&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;expression&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# Print the name of the residential road&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'{0}, {1}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "C:\Users\adminjk\Desktop\PythonSync\Python Scripts\SearchCursor2.py", line 16, in &amp;lt;module&amp;gt;&lt;BR /&gt; for row in cursor:&lt;BR /&gt;RuntimeError: Attribute column not found [42S22:[Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'No'.] [DGIF_TEST.DBO.Inspection_2]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:56:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/search-cursor/m-p/473681#M37016</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2021-12-11T20:56:45Z</dc:date>
    </item>
  </channel>
</rss>

