Hello,
I am updating a script which was used in ArcMap (python 2) to ArcPro (python 3). This script is ran through ArcPro with the layers loaded into the map.
I have a script which references a sde file (a table):
sTabName = "SDE_Company.ADMIN.Cadaster"
which firstly does a search cursor to get some data
with arcpy.da.SearchCursor(sTabName, ('X','Y','Z')) as oRows
this works,
But later on I need to update sTabName so I use:
with arcpy.da.UpdateCursor(sTabName, ("Z")) as oRows
the script hangs and gets stuck at this point. I have not used "edit.startOperation()" as the with statement should handle the editing opening and closing.
Does ArcPro have more strict schema locking than ArcMap, which is causing this issue? This script worked fine in ArcMap.
I have ran:
if arcpy.TestSchemaLock(sTabName):
at the start of the script and sTabName has a lock on it, as it is open in the current map (it is also open by other user profiles in the business)
Is this causing the issues/hang?
How can I work around this to update the sTabName table?