Hello,
I am having some difficulties using an updateCursor. I am running this script via the python terminal within ArcPro. When I run the updateCrusor, it hangs for 30+ minutes then has an error, "error: cannot update table". Can someone please verify that I have set up the cursor and edit session correctly, and provide any insight into why it might not work.
I have the following variables:
sTable_path = r" path... @SDE.sde\SDE.Serv_TEST_FILE" #full path to the table
SDE_Workspace_Path = r" path... @SDE.sde" #path to the SDE connection
sTab = r"SDE.Serv_TEST_FILE" #table name #name of the table I want to update
I then set up my edit session and attempt to do some updates, it gets stuck at the updateCursor.
edit = arcpy.da.Editor(SDE_Workspace_Path) #opening workspace path
edit.startEditing(False, True)
edit.startOperation()
try:
print("Retiring old assessment(s)...")
with arcpy.da.UpdateCursor(sTable_path, ("RecordStatus", "Retired"), where_clause=sOldWhere) as oRows:
It doesn't seem to matter if I use sTable_path or sTab in the updateCursor, both cause it to hang. I've checked if the item is locked.
arcpy.TestSchemaLock(sTable_path) returns True, so the item should be able to be edited. Is there anything else I should check if it is a table lock issue?