I am new to ArcGIS and arcpy and am learning largely through trial and error. Anyway, the overall task is to delete, edit and add rows to feature classes.
I thought it would be good to start with delete - it seemed the simplest. In the desktop I can change to a version, start an editing session and delete the object. However, when I try the script below, it fails with a database error. On the desktop I don't seem to be able to delete unless I do 'Start Editing', but I can't find that in arcpy for 10.0. I see over the years other posts but nothing quite like this. Is this something that I should be able to do with arcpy?
arcpy.env.workspace = myconnect versions = arcpy.ListVersions() versionName = "montgs1" layer='layer' arcpy.MakeFeatureLayer_management("ARCFM.DistributionMain", "layer") arcpy.ChangeVersion_management(layer, 'TRANSACTIONAL', user + "."+versionName,'') qry ='"OBJECTID" in (3142049,4228649)' arcpy.SelectLayerByAttribute_management(layer, "NEW_SELECTION", qry) numsel =int(arcpy.GetCount_management(layer).getOutput(0)) if numsel > 0: print str(numsel) + ' features selected' arcpy.DeleteFeatures_management(layer)
Incidentally, when I use that criteria in the gui, it selects two items, however in the script numsel's value is 1.
Anyway, when the delete happens I get this:
(, ExecuteError('ERROR 999999: Error executing function.\nUnable to create logfile system tables. User perhaps lacks permissions or resources to create tables\nUnderlying DBMS error [ORA-01455: converting column overflows integer datatype\n] [ARCFM.DistributionMain]\nFailed to execute (DeleteFeatures).\n',), )
Why does it work on the GUI but not with arcpy?