BUG
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.
Code:
from win32com.client import Dispatch
gp=Dispatch("esriGeoprocessing.GPDispatch.1")
gp.workspace="Database Connections/Ora9204Helium.sde"
try:
table = "SYSTEM.rn_test"
rows = gp.UpdateCursor(table, "SHAPE.LEN > 20")
row = rows.next()
while row:
row.ATTR = 200
rows.UpdateRow(row)
row = rows.next()
except:
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.
Note:
More information can be found on Disconnected Editing in the ArcGIS Desktop Help. Select Building a Geodatabase > Disconnected editing on the Contents tab.
Get help from ArcGIS experts
Download the Esri Support App