This is the bottom half of my code (and it's been edited somewhat to share publicly). The code works perfectly fine when the fieldList
has only three fields in it, but when I populate it with all 108 fields, I receive the following error, just before it starts to calculate fields:
Traceback (most recent call last):
File "C:\GIS\1GIS_DATA\Folder1\Folder2\Python and Tools\RunThisPythonCode.py", line 125, in <module>
value = row.getValue(field)* row.anotherField #<--This is the line the error is referring to
File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\arcobjects.py", line 944, in getValue
return convertArcObjectToPythonObject(self._arc_object.GetValue(*gp_fixargs(args)))
RuntimeError: ERROR 999999: Error executing function.
Here's the code:
....
fc = arcpy.CopyFeatures_management(layerName, outFeatures)
#---------------------------------------------
# Add fields to a feature class:
#---------------------------------------------
fieldList = ["field1", "field2", "field3", ............., "field99"] #<-- fieldList
fieldListx = []
for f in fieldList:
fieldx = f+"x"
arcpy.AddField_management(fc, fieldx, "DOUBLE")
fieldListx.append(fieldx)
#---------------------------------------------
# Calculate fields:
#---------------------------------------------
rows = arcpy.UpdateCursor(fc)
for row in rows:
for fieldx in fieldListx:
field = fieldx.rstrip('x')
value = row.getValue(field)* row.anotherField #<--This is the line the error is referring to
row.setValue(fieldx,value)
rows.updateRow(row)
del row, rows
Is this an issue of memory or something? Why does it produce an error before Calculate Fields when I add the full list of 108 fields, but not when I run a small sample of only 3? Thanks!!