[Tutor] Editing Data in Non Versioned SDE Using python With An Update Cursor
Nicole King
nicole at resourceinnovations.ca
Fri Jan 13 10:40:25 EST 2017
Hello,
I have a python script that calculates x coordinates , y coordinates for a
point geometry that sits within a feature dataset of an SDE (SQL Express).
The script worked fine on a file geodatabase however when it runs on the SDE
feature class, it stalls at the updateCursor function.
"ERROR: 999999: Error executing function....Objects in the class cannot be
updated outside an edit session [FSB.DBO.Structures]"
The script breaks on updCursor.updateRow(row):
workspace = arcpy.env.workspace ="insertworkspace"
edit = arcpy.da.Editor(workspace)
edit.startEditing(False, True)
edit.startOperation()
updCursor = arcpy.UpdateCursor(projectedFC,"", spatialRef)
for row in updCursor:
pnt = row.Shape.getPart(0)
row.POINT_X = pnt.X
row.POINT_Y = pnt.Y
updCursor.updateRow(row)
del updCursor, row
edit.stopOperation()
edit.stopEditing(True)
If anyone has any information, ideas or input on editing data in non
versioned SDE with a update cursor using python it would be greatly
appreciated.
Thank you,
Nicole King
Forest Interpretation Specialist
Resource Innovations Inc.
Bus: (709) 639-8275
Fax: (709) 639-8758
<https://www.facebook.com/resourceinnovations>
<https://www.linkedin.com/company/resource-innovations-inc->
<https://twitter.com/resinnovations>
<https://www.youtube.com/user/resourceinnovations>
<http://www.resourceinnovations.ca/>
More information about the Tutor
mailing list