<?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: arcpy.da.instercursor adding blank rows. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-da-instercursor-adding-blank-rows/m-p/65081#M5345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you're starting and immediately stopping an edit session, you may as well remove all that and see if it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Sep 2018 16:27:49 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2018-09-07T16:27:49Z</dc:date>
    <item>
      <title>arcpy.da.instercursor adding blank rows.</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-instercursor-adding-blank-rows/m-p/65080#M5344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to copy a table from an oracle server to a filegdb table.&amp;nbsp; I can get the searchcursor to work and I can get the insercursor to add all the rows but the field values are all blank.&amp;nbsp; Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999999;"&gt;arcpy.CreateTable_management(targetPath,targetTableName,SourceTableFullPath,"#")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999999;"&gt; field_names = [f.name for f in arcpy.ListFields(SourceTableFullPath)]&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; edit = arcpy.da.Editor(targetPath)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999999;"&gt; edit.startEditing(False,True)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; edit.startOperation()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; cursor = arcpy.da.InsertCursor(TargetTablefullPath,field_names)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999999;"&gt; i = 0 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; for row in arcpy.da.SearchCursor(SourceTableFullPath, field_names, sourceFilterString):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;i = i + 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999999;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print row[0] + " " + row[1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;cursor.insertRow(row)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if i &amp;gt; 10:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;print i&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;break&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999999;"&gt; print "added rows?"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; edit.stopOperation()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; edit.stopEditing(True)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #999999;"&gt; del row&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #999999;"&gt; del cursor&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2018 16:05:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-instercursor-adding-blank-rows/m-p/65080#M5344</guid>
      <dc:creator>Lim_Shane</dc:creator>
      <dc:date>2018-09-07T16:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.instercursor adding blank rows.</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-instercursor-adding-blank-rows/m-p/65081#M5345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you're starting and immediately stopping an edit session, you may as well remove all that and see if it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2018 16:27:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-instercursor-adding-blank-rows/m-p/65081#M5345</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-09-07T16:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.instercursor adding blank rows.</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-instercursor-adding-blank-rows/m-p/65082#M5346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't have any of that in to begin with.&amp;nbsp; I just started at creating the cursor but I still have the same problem.&amp;nbsp; I also tried doing it to a personal GDB.&amp;nbsp; All I can think of is that the new table gets an objectid field and somehow that is messing with the field count but even when I only call out two fields manually they still go in blank.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2018 16:33:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-instercursor-adding-blank-rows/m-p/65082#M5346</guid>
      <dc:creator>Lim_Shane</dc:creator>
      <dc:date>2018-09-07T16:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.instercursor adding blank rows.</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-instercursor-adding-blank-rows/m-p/65083#M5347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #d4d4d4;"&gt;&lt;SPAN style="color: #000000;"&gt;I ended up creating a second copy of the table to insert into.&amp;nbsp; The first table is somehow read only.&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM style="color: #000000;"&gt;outTbl = str(arcpy.CreateTable_management(targetPath,targetTableName,SourceTableFullPath,"#").getOutput(0))&lt;BR /&gt;&lt;BR /&gt;outTable2 = str(arcpy.TableToTable_conversion(outTbl,targetPath, targetTableName2 ).getOutput(0))&lt;/EM&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4;"&gt;&lt;SPAN style="color: #d4d4d4;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2018 18:45:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-instercursor-adding-blank-rows/m-p/65083#M5347</guid>
      <dc:creator>Lim_Shane</dc:creator>
      <dc:date>2018-09-07T18:45:18Z</dc:date>
    </item>
  </channel>
</rss>

