Error using UpdateCursor to copy a GlobalID field

المشرف العام

Administrator
طاقم الإدارة
I am trying to use an Update Cursor to copy a GlobalID field into a string field. However, I keep getting an error saying "Objects in this class cannot be updated outside an edit session [Medians]".

Aren't I initiating as edit session by using arcpy.da?

The error occurs on the fourth line.

workspace = "x/y/z" edit=arcpy.da.Editor(workspace) cursor = arcpy.da.UpdateCursor(medians, ("GlobalID", "GlobalID2",)) for row in cursor: globalID = row[0] globalID = globalID[1:-1] row[1]=globalID cursor.updateRow(row)

أكثر...
 
أعلى