<?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 Update Cursor error in file geodatabase: RuntimeError: An expected Field... in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-cursor-error-in-file-geodatabase/m-p/160845#M12300</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to replace &amp;lt;NULL&amp;gt; values in a number of fields for a shapefile in a file geodatabase. The hope is that once I do this, field calculator will be friendlier in the model I'm building. Below is the part of the script that is giving me trouble and the error. I repeat this section for each field. I've based my code on a tutorial from Paul Zandbergen's Python Scripting for ArcGIS book (I'm new to python) and have scoured forums for solutions with no luck. The line the error references is the "for row in cursor:" line. All lines before this section are just import, workspace and # lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Update ElevSTD to replace NULL with 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delimElev = arcpy.AddFieldDelimiters(fc, ["ElevSTD"])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cursor = arcpy.da.UpdateCursor(fc, ["ElevSTD"], delimElev + ' = None')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del row&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del cursor&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exec codeObject in __main__.__dict__&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Arkansas GIS Appendix\ReplaceNulls.py", line 14, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: An expected Field was not found or could not be retrieved properly. [Cores_SpJnSoilsVar]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help or insight you can provide!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Aug 2013 16:43:00 GMT</pubDate>
    <dc:creator>CharlesKline</dc:creator>
    <dc:date>2013-08-01T16:43:00Z</dc:date>
    <item>
      <title>Update Cursor error in file geodatabase: RuntimeError: An expected Field...</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-error-in-file-geodatabase/m-p/160845#M12300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to replace &amp;lt;NULL&amp;gt; values in a number of fields for a shapefile in a file geodatabase. The hope is that once I do this, field calculator will be friendlier in the model I'm building. Below is the part of the script that is giving me trouble and the error. I repeat this section for each field. I've based my code on a tutorial from Paul Zandbergen's Python Scripting for ArcGIS book (I'm new to python) and have scoured forums for solutions with no luck. The line the error references is the "for row in cursor:" line. All lines before this section are just import, workspace and # lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Update ElevSTD to replace NULL with 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delimElev = arcpy.AddFieldDelimiters(fc, ["ElevSTD"])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cursor = arcpy.da.UpdateCursor(fc, ["ElevSTD"], delimElev + ' = None')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del row&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del cursor&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exec codeObject in __main__.__dict__&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Arkansas GIS Appendix\ReplaceNulls.py", line 14, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: An expected Field was not found or could not be retrieved properly. [Cores_SpJnSoilsVar]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help or insight you can provide!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 16:43:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-error-in-file-geodatabase/m-p/160845#M12300</guid>
      <dc:creator>CharlesKline</dc:creator>
      <dc:date>2013-08-01T16:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Update Cursor error in file geodatabase: RuntimeError: An expected Field...</title>
      <link>https://community.esri.com/t5/python-questions/update-cursor-error-in-file-geodatabase/m-p/160846#M12301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nevermind, fixed it! I checked out this forum discussion for help and it worked:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/89511-Change-Nulls-to-Blanks"&gt;http://forums.arcgis.com/threads/89511-Change-Nulls-to-Blanks&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my working code if anyone cares to know:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#Update ElevSTD to replace NULL with 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;delimElev = arcpy.AddFieldDelimiters(fc, "ElevSTD")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cursor = arcpy.da.UpdateCursor(fc, "ElevSTD", delimElev + ' IS NULL')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[0] = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor.updateRow(row)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del cursor&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 17:08:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-cursor-error-in-file-geodatabase/m-p/160846#M12301</guid>
      <dc:creator>CharlesKline</dc:creator>
      <dc:date>2013-08-01T17:08:11Z</dc:date>
    </item>
  </channel>
</rss>

