I'm creating a table using arcpy with a list of results (stored in 2d lists) following an update to some features. This can sometimes include geometry, so I've attempted to substitute those for a basic string to avoid any conflicts - all fields are TEXT. Still, I get this error - File "I:\IPP Geomatics Standards\Toolbox\Staging\Scripts\update_attributes.py", line 93, in resultsTable cursor.insertRow([z if z is not u[index] else 'Geom' for z in u], "update") RuntimeError: table has no geometry
The 'index' variable is the known index in the list containing a geometry. This is the offending part of the function -
cursor = arcpy.da.InsertCursor(tablews + "\\results", nfields) for u in updatel: cursor.insertRow([z if z is not u[index] else 'Geom' for z in u], "update")
This should be omitting geometry altogether, but still gets flagged.
I suspect my insert statement is incorrect. As per ESRI documentation, one can insert multiple entries (i.e. one for each field) like so -
cursor.insertRow((x, y, z))
In this case, "u" is a list, and I'm trying to split it into separate entries, to the same end. The cursor must be interpreting the array as one entry, in the first field.