AnsweredAssumed Answered

can't edit row with arcpy.da.updatecursor in arcmap

Question asked by bdridaho on Mar 13, 2016
Latest reply on Mar 15, 2016 by bdridaho

I am at a loss! After hours of searching and testing, in Arcmap (10.3)  I simpy can't get beyond this error:

RuntimeError: Objects in this class cannot be updated outside an edit session [ContactsAndFaults]

while attempting to open an UpdateCursor. The feature class is in a personal database and I am able to add a field, but not use the following:

 

uid = fc + "Somestring"
with arcpy.da.UpdateCursor("C:\\arcmaptest\\Paddock_Valley_Reservoir.mdb\\" + fc, ("OID@", uid)) as cursor:
     for row in cursor:
          row[1] = fc + "-" + anotherstring+ "-" + row[0]  # basically append the OBJECTID to the uid string
          cursor.updateRow(row)

 

 

Any suggestions?

Outcomes