LynnRossman

Is it possible to update a versioned SDE database with Python?

Discussion created by LynnRossman on Jun 21, 2012
Latest reply on Jun 21, 2012 by LynnRossman
I am using ArcGISDesktop 10 SP4, Python v2.6.5, and Oracle 11g.  I can successfully update shapefiles, etc. but have been unable to get the updateRow command to execute successfully against a versioned SDE database.  Here is a simple code example.  The updateRow line won't run.

import arcpy
conn = arcpy.env.workspace = "c:\\ESRIOracleConnection\\EDGE11.sde\\ADMIN.TestPoint"

sRow = None
rows = None
err = None
       
try:
    rows = arcpy.UpdateCursor(conn)
    for sRow in rows:
        if str(sRow.CPTestPointNumber) == "101650":
            print sRow.CPTestPointNumber,sRow.COMMENTS
            sRow.COMMENTS = "HELLO WORLD"
            print sRow.CPTestPointNumber,sRow.COMMENTS
            rows.updateRow(sRow)
            print sRow.CPTestPointNumber,sRow.COMMENTS
               
except Exception, ErrorMessage:
    err = "ERROR" + str(ErrorMessage)

finally:
    del sRow, rows

Outcomes