<?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: Avoiding errors when adding rows to blank table using ArcPy? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354342#M27854</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PROGRAM SECTION EVEN and RELATE FILL ORDERED... those were the days!&lt;/P&gt;&lt;P&gt;AML forever, brother!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Apr 2017 15:38:14 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2017-04-21T15:38:14Z</dc:date>
    <item>
      <title>Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354337#M27849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; margin: 0px 0px 1em;"&gt;I am having problems when using ArcPy with ArcGIS Desktop to add in a set number of rows into a .dbf table.&lt;/P&gt;&lt;P style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; margin: 0px 0px 1em;"&gt;What should I do to prevent these errors?&lt;/P&gt;&lt;P style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; margin: 0px 0px 1em;"&gt;Here is a sample code that gives me errors:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;##########setup###########
import arcpy, os
from arcpy import env


##########parameters##########

ws = r'C:\Users\ddsouth\Documents\Python_tests'
env.workspace = ws

newFile = "adding_table_rows_test_5"
newFileFull = os.path.join(ws, newFile) + ".dbf"

###########code###############

#create the table
arcpy.CreateTable_management(ws, newFile)
arcpy.AddField_management(newFileFull, "RouteName", "TEXT", "", "", 15)
arcpy.AddField_management(newFileFull, "DepotName", "TEXT", "", "", 15)

#edit the table
cursor = arcpy.da.InsertCursor(newFile, ["ROUTENAME"])

for q in range (0,10):
 cursor.insertRow((str(1),))
del cursor

print "Completed."&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; margin: 0px 0px 1em;"&gt;The creation of the table goes fine the first time, then when it comes to the edit portion I get the following error message:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;Runtime&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; error &lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;Traceback&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;most recent call last&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;):&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;&amp;nbsp; 
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;File&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;"&gt;"&amp;lt;string&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; line &lt;/SPAN&gt;&lt;SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;"&gt;26&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #101094; border: 0px; font-size: 13px;"&gt;in&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;module&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;SystemError&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; error &lt;/SPAN&gt;&lt;SPAN class="" style="color: #101094; border: 0px; font-size: 13px;"&gt;return&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; without exception set&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/BLOCKQUOTE&gt;&lt;/PRE&gt;&lt;P style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; margin: 0px 0px 1em;"&gt;Then if I run the program again, I get a different error, this time during the creation of the table, even if I have the "Overwrite the outputs of geoprocessing operations" option selected:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;Runtime&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; error&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;Traceback&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;most recent call last&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;):&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; 
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;File&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;"&gt;"&amp;lt;string&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; line &lt;/SPAN&gt;&lt;SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;"&gt;18&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #101094; border: 0px; font-size: 13px;"&gt;in&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;module&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; 
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;File&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;"&gt;"c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; 
line &lt;/SPAN&gt;&lt;SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;"&gt;15715&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #101094; border: 0px; font-size: 13px;"&gt;in&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;CreateTable&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #101094; border: 0px; font-size: 13px;"&gt;raise&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; e &lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;ExecuteError&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; ERROR &lt;/SPAN&gt;&lt;SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;"&gt;001143&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-size: 13px;"&gt;Background&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt; server threw an exception&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"&gt;.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/BLOCKQUOTE&gt;&lt;/PRE&gt;&lt;P style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; margin: 0px 0px 1em;"&gt;I also noticed that while the tables I created appear in ArcCatalog, they do not appear in Windows Explorer, there is only a LOCK file while ArcMap is open.&lt;/P&gt;&lt;P style="color: #242729; background-color: rgba(248, 248, 248, 0.6); border: 0px; margin: 0px 0px 1em;"&gt;What should be done? Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:36:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354337#M27849</guid>
      <dc:creator>DavidSouth2</dc:creator>
      <dc:date>2021-12-11T16:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354338#M27850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cross-posted to StackExchange:&amp;nbsp; &lt;A href="https://gis.stackexchange.com/questions/237189/avoiding-errors-when-adding-rows-to-blank-table-using-arcpy"&gt;Avoiding errors when adding rows to blank table using ArcPy?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this is a question, it is best to mark it as a question instead of a discussion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 02:11:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354338#M27850</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-04-21T02:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354339#M27851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean to be working with Info or dBASE tables?&amp;nbsp; Your code as written is creating an Info table and trying to insert records into it.&amp;nbsp; I am surprised the Add Field calls aren't generating errors.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 02:19:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354339#M27851</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-04-21T02:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354340#M27852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed you opened the cursor on newFile, not newFileFull, which is missing the .dbf extension. Mr Bixby is right on that a table path in a folder with no .dbf tacked on is interpreted as an INFO table path. Good old INFO. A humble personal financial database put into service mapping the world.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really like to make table views both for performance reasons when I run multiple tools on a single input (speedier validation) but also this can insulate your from path specification errors like that.&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="comment token"&gt;#create the table&lt;/SPAN&gt;
tbl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateTable_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ws&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; newFile&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
tv &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeTableView_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"tv"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tv&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"RouteName"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;15&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tv&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DepotName"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;15&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#edit the table&lt;/SPAN&gt;
cursor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;InsertCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tv&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ROUTENAME"&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="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# clean up tv&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tv&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;/CODE&gt;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:36:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354340#M27852</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T16:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354341#M27853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for hijacking this thread....&lt;/P&gt;&lt;P&gt;Back in the day, my bookshelf contained a photocopied version of "Understanding Info" by Henco software.&lt;/P&gt;&lt;P&gt;It was my bible in those days.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 07:49:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354341#M27853</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2017-04-21T07:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354342#M27854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PROGRAM SECTION EVEN and RELATE FILL ORDERED... those were the days!&lt;/P&gt;&lt;P&gt;AML forever, brother!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 15:38:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354342#M27854</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-04-21T15:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354343#M27855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I will remember this for next time. I am still getting used to how this site works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 20:21:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354343#M27855</guid>
      <dc:creator>DavidSouth2</dc:creator>
      <dc:date>2017-04-21T20:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354344#M27856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Curtis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the response. I have changed my code to look like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;##########setup###########&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env

&lt;SPAN class="comment token"&gt;##########parameters##########&lt;/SPAN&gt;

ws &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\Users\ddsouth\Documents\Python_tests'&lt;/SPAN&gt;
env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ws

newFile &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"adding_table_rows_test_3"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;###########code###############&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#create the table&lt;/SPAN&gt;
tbl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateTable_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ws&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; newFile&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
tv &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeTableView_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tbl&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"tv"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tv&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"RouteName"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;15&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddField_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tv&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DepotName"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"TEXT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;15&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#edit the table&lt;/SPAN&gt;
cursor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;InsertCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tv&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"ROUTENAME"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; q &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range &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="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insertRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;str&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="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor

&lt;SPAN class="comment token"&gt;#clean up tv&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tv&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;/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;print "Completed."&lt;/P&gt;&lt;P&gt;Yet I still get the error on the "cursor.insertRow((str(1),))" line:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Runtime error&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;SystemError: error return without exception set&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Is there a way to fix this? I really appreciate the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:37:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354344#M27856</guid>
      <dc:creator>DavidSouth2</dc:creator>
      <dc:date>2021-12-11T16:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354345#M27857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean to be working with Info or dBASE tables?&amp;nbsp; Your code as written is still creating an Info table and trying to insert records into it.&amp;nbsp; Before I get into explaining Info-related issues with cursors, I want to make sure you want to be working with Info tables.&amp;nbsp; Do you have to be working with Info tables or would dBASE work as well?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 20:46:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354345#M27857</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-04-21T20:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354346#M27858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to be clear, the change you need is to set the output pathname with a #dbf extension. This is only necessary when the output workspace (ws) is a folder, with no extension there is an assumption you have created an info folder with the CreateWorkspace command or by running a tool that creates an INFO directory. This is historical compatibility; these days you should avoid INFO table format unless you have no way around it (for example, coverage and Esri grid formats).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;newFile = "adding_table_rows_test_3.dbf"&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="border: 0px; font-size: 14px;"&gt;&lt;/P&gt;&lt;P style="border: 0px; font-size: 14px;"&gt;&lt;STRONG style="background-color: #f6f6f6; font-weight: normal;"&gt;I also would not use this: &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="border: 0px; font-size: 14px;"&gt;&lt;STRONG style="background-color: #f6f6f6;"&gt;cursor.insertRow((str(1),))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="border: 0px; font-size: 14px;"&gt;&lt;STRONG style="background-color: #f6f6f6; font-weight: normal;"&gt;but instead, this. (I just like lists over tuples, you can simply do more with them.)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="border: 0px; font-size: 14px;"&gt;&lt;STRONG style="background-color: #f6f6f6;"&gt;cursor.insertRow(["1"])&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Apr 2017 23:26:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354346#M27858</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-04-21T23:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354347#M27859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dBASE would work just fine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Apr 2017 23:58:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354347#M27859</guid>
      <dc:creator>DavidSouth2</dc:creator>
      <dc:date>2017-04-24T23:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Avoiding errors when adding rows to blank table using ArcPy?</title>
      <link>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354348#M27860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Curtis, thank you for the effort you have taken to help me. The code now works! Giving it the .dbf extension seems to have done the trick!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much to everyone who has helped!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 00:06:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/avoiding-errors-when-adding-rows-to-blank-table/m-p/354348#M27860</guid>
      <dc:creator>DavidSouth2</dc:creator>
      <dc:date>2017-04-25T00:06:21Z</dc:date>
    </item>
  </channel>
</rss>

