Select to view content in your preferred language

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

745
1
06-21-2012 10:38 AM
LynnRossman
New Contributor
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
Tags (2)
0 Kudos
1 Reply
LynnRossman
New Contributor
I figured out my issue.  It was because my features were also using Telvent (Miner & Miner's) software.  When I revereted back to soley ESRI objects the program worked fine.  I will take up this issue with Telvent.  Thank you.
0 Kudos