method 'updateRow' of 'da.UpdateCursor' objects returned a result with an error set, RuntimeError: This type of cursor does not support this operati

2173
10
Jump to solution
10-05-2022 09:23 AM
MavTucker
New Contributor II

I have a script (running/deving it in Pro 2.9, will eventually be scheduled) that is gathering data from other SDE tables into a dictionary row, and then updating a traditionally versioned feature class (10.9.1 gdb) with that data. I am connected via a child version of default using the data owner user. When my script attempts to update a row, I get the error message in the title. I cannot for the life of me figure out why, or how to see more detail of the error. My related update code is as below:

SQL = "PPIN IS NOT NULL"

workspace = os.path.dirname(parcels)
workspace = os.path.dirname(workspace)
edit = arcpy.da.Editor(workspace)
edit.startEditing(with_undo=False, multiuser_mode=True)
edit.startOperation()
uParcel = arcpy.da.UpdateCursor(parcels, Pfields, SQL)
for row in uParcel :
    PPIN = row[0]
    newRow = parcelDict[PPIN]
    if newRow == row[1:] :
        print(PPIN)
    else :
        row[1:] = newRow
        uParcel.updateRow(row)

 

0 Kudos
10 Replies
BlakeTerhune
MVP Regular Contributor

But does the with statement work in both scenarios?

 

with arcpy.da.UpdateCursor(parcels, Pfields, SQL)as uCursor:

 

0 Kudos