Hi all.
I'm running into a problem with an UpdateCursor in arcpy.
As soon as the script is encountering the UpdateCursor line, it ends with an error "Cannot update table".
I can run a SearchCursor over the feature class without problems, just the UpdateCursor fails every time.
This is the (very simplified) code I'm looking at:
connection = "C:\\Users\\user_name\\AppData\\Roaming\\ESRI\\Desktop10.8\\ArcCatalog\\database.gds\\Utilities (VERSION:dbo.DEFAULT)"
fc = "CV_Valves"
fc_path = f"{connection}\\{fc}"
edit = arcpy.da.Editor(connection)
edit.startEditing(False, True)
edit.startOperation()
with arcpy.da.UpdateCursor(fc_path, "OBJECTID") as cursor:
for row in cursor:
print(row[0])
# cursor.updateRow(row)
edit.stopOperation()
edit.stopEditing(True)
I have the updateRow line commented out for testing purposes, and the actual user_name and db name are replaced by placeholders. I realize that the code is not updating anything, and this is just show the error I'm running into. I'm running Python 3.9
I'm not sure if this has something to do with the SDE I'm connecting to, because the code is simple enough where it shouldn't throw any errors. The same procedure works fine when I connect to an SDE DB on a different system. As I mentioned above, I can run a SearchCursor over the same table without any issues.
Any help or pointers would be greatly appreciated.
Thanks!
Mard