Cannot edit SDE data with Python update or insert cursors

Last Published: April 25, 2020


Update and insert cursors fail when trying to edit SDE data using a Python script. For example, the script below should edit field values in an SDE feature class. This code runs without error, however, the attribute values are not changed.

from win32com.client import Dispatch
gp.workspace="Database Connections/Ora9204Helium.sde"
table = "SYSTEM.rn_test"
rows = gp.UpdateCursor(table, "SHAPE.LEN > 20")
row = rows.next()
while row:
row.ATTR = 200
row = rows.next()
del rows
del row


This is a known limit. This is only a problem with versioned SDE data. If the data is not versioned, then the above code works as expected.


A possible workaround is to use disconnected editing. This allows a user to check out ArcSDE data to a personal geodatabase. Once the data is in a personal geodatabase, insert and update cursors will work correctly. After editing is complete, check the data into the ArcSDE database.

More information can be found on Disconnected Editing in the ArcGIS Desktop Help. Select Building a Geodatabase > Disconnected editing on the Contents tab.

    Article ID:000007454

    • ArcMap 9 x

    Receive notifications and find solutions for new or common issues

    Get summarized answers and video solutions from our new AI chatbot.

    Download the Esri Support App

    Discover more on this topic

    Get help from ArcGIS experts

    Contact technical support

    Download the Esri Support App

    Go to download options