<?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: RuntimeError: ERROR 999999: Error executing function. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/runtimeerror-error-999999-error-executing-function/m-p/46838#M3763</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change Line 24 in your code to this:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14600490930905013" data-renderedposition="34_8_1332_16" jivemacro_uid="_14600490930905013" modifiedtitle="true"&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;cursorIn = arcpy.UpdateCursor(insumo)&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;TABLE class="arcpyclass_paramtbl" style="margin-bottom: 1.5em; font-size: 0.875em; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; border: 1px solid #dddddd; color: #4d4d4d; background-color: white;"&gt;&lt;TBODY&gt;&lt;TR style="border-bottom-width: 1px; border-bottom-color: #dddddd;"&gt;&lt;TD style="border-left-width: 1px; border-left-style: solid; border-left-color: #dddddd; border-right-width: 1px; border-right-style: solid; border-right-color: #dddddd; padding: 12px;"&gt;&lt;P&gt;dataset&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-left-width: 1px; border-left-style: solid; border-left-color: #dddddd; border-right-width: 1px; border-right-style: solid; border-right-color: #dddddd; padding: 12px;"&gt;&lt;P style="font-size: 0.875rem;"&gt;The feature class, shapefile, or table containing the rows to be updated or deleted.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Apr 2016 17:29:15 GMT</pubDate>
    <dc:creator>AndrewKeith3</dc:creator>
    <dc:date>2016-04-07T17:29:15Z</dc:date>
    <item>
      <title>RuntimeError: ERROR 999999: Error executing function.</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-error-999999-error-executing-function/m-p/46837#M3762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I'm trying to write in test field from some layer based on iterate feature selction. I get succes using model builder but I'm fail when I try with my own code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;The process with MB.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;IMG alt="mb.jpg" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/190635_mb.jpg" style="width: 620px; height: 605px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;The code and error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;IMG alt="mycode.jpg" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/190636_mycode.jpg" style="width: 620px; height: 283px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Here is the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;import arcpy&lt;/LI&gt;&lt;LI&gt;from arcpy import env&lt;/LI&gt;&lt;LI&gt;env.workspace = r'D:\Eric\Ejercicio\shp\ejercicioTest.gdb\shp'&lt;/LI&gt;&lt;LI&gt;crbuff = r'D:\Eric\Ejercicio\shp\ejercicioTest.gdb\shp\CRojaPBuff'&lt;/LI&gt;&lt;LI&gt;insumo = r'D:\Eric\Ejercicio\shp\ejercicioTest.gdb\shp\Insumo'&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;# Add field to insumo.&lt;/LI&gt;&lt;LI&gt;arcpy.AddField_management(insumo, "test", "TEXT", "", "", "50", "", "NULLABLE", "NON_REQUIRED", "")&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;# Make a layer from crbuff to get the select by location works.&lt;/LI&gt;&lt;LI&gt;arcpy.MakeFeatureLayer_management (crbuff, 'crbuff_layer')&lt;/LI&gt;&lt;LI&gt;arcpy.MakeFeatureLayer_management (insumo, 'insumo_layer')&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;# loop with cursor&lt;/LI&gt;&lt;LI&gt;cursor = arcpy.SearchCursor(crbuff)&lt;/LI&gt;&lt;LI&gt;field = "Lab" # Specify the field in the loop.&lt;/LI&gt;&lt;LI&gt;for row in cursor:&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print (row.getValue(field))&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByLocation_management('insumo_layer', "HAVE_THEIR_CENTER_IN", 'crbuff_layer', "", "NEW_SELECTION", "NOT_INVERT")&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Calculate Field.&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursorIn = arcpy.UpdateCursor('insumo_layer')&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursorIn:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue("test", row.getValue(field))&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursorIn.updateRow(row)&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;# Process: Summary Statistics.&lt;/LI&gt;&lt;LI&gt;intable = r'D:\Eric\Ejercicio\shp\Insumo.shp'&lt;/LI&gt;&lt;LI&gt;outtable = r'D:\Eric\Ejercicio\shp'&lt;/LI&gt;&lt;LI&gt;arcpy.Statistics_analysis(intable, outtable + "stats.dbf", "POB1 SUM;POB8 SUM;POB11 SUM;POB14 SUM;POB15 SUM;POB16 SUM;POB24 SUM;POB31 SUM;POB57 SUM;MIG7 SUM;INDI1 SUM;DISC1 SUM;DISC4 SUM;DISC5 SUM;DISC6 SUM;ECO1 SUM;ECO4 SUM;ECO25 SUM;ECO28 SUM;SALUD1 SUM;SALUD2 SUM;SALUD3 SUM;SALUD4 SUM;SALUD5 SUM;SALUD6 SUM", "test")&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 16:35:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-error-999999-error-executing-function/m-p/46837#M3762</guid>
      <dc:creator>G__EricCastillo_Morales</dc:creator>
      <dc:date>2016-03-10T16:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: RuntimeError: ERROR 999999: Error executing function.</title>
      <link>https://community.esri.com/t5/python-questions/runtimeerror-error-999999-error-executing-function/m-p/46838#M3763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change Line 24 in your code to this:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14600490930905013" data-renderedposition="34_8_1332_16" jivemacro_uid="_14600490930905013" modifiedtitle="true"&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;cursorIn = arcpy.UpdateCursor(insumo)&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;TABLE class="arcpyclass_paramtbl" style="margin-bottom: 1.5em; font-size: 0.875em; font-family: 'Lucida Grande', 'Segoe UI', Arial, sans-serif; border: 1px solid #dddddd; color: #4d4d4d; background-color: white;"&gt;&lt;TBODY&gt;&lt;TR style="border-bottom-width: 1px; border-bottom-color: #dddddd;"&gt;&lt;TD style="border-left-width: 1px; border-left-style: solid; border-left-color: #dddddd; border-right-width: 1px; border-right-style: solid; border-right-color: #dddddd; padding: 12px;"&gt;&lt;P&gt;dataset&lt;/P&gt;&lt;/TD&gt;&lt;TD style="border-left-width: 1px; border-left-style: solid; border-left-color: #dddddd; border-right-width: 1px; border-right-style: solid; border-right-color: #dddddd; padding: 12px;"&gt;&lt;P style="font-size: 0.875rem;"&gt;The feature class, shapefile, or table containing the rows to be updated or deleted.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 17:29:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/runtimeerror-error-999999-error-executing-function/m-p/46838#M3763</guid>
      <dc:creator>AndrewKeith3</dc:creator>
      <dc:date>2016-04-07T17:29:15Z</dc:date>
    </item>
  </channel>
</rss>

