from vrbls import * arcpy.env.workspace = database workspace = arcpy.env.workspace arcpy.env.overwriteOutput = True edit = arcpy.da.Editor(workspace) edit.startEditing(False, True) edit.startOperation() insert_cursor = arcpy.da.InsertCursor(perm_bound, ["PermitNo", "FeatCLS", "Contact", "Source", "National_ID", "Type_Flag", "Calc_Acres", 'SHAPE@']) with arcpy.da.SearchCursor(perm_bound_file_geodb, ["PermitNo", "FeatCLS", "Contact", "Source", "National_ID", "Type_Flag", "Calc_Acres", 'SHAPE@']) as cursor: for row in cursor: insert_cursor.insertRow(row) print('row inserted') del cursor del insert_cursor edit.startEditing(False, True) edit.startOperation()
I do not have any problem using this code in a file geodatabase and it works fine. It does not work inside an enterprise geodatabase and does not insert any rows yet I do not get any error and it exits with zero code.
Solved! Go to Solution.
Is the EGDB versioned? Where is stopOperation() and stopEditing(True)?
you may have luck with edit.startEditing(False, False)
Does your user have the correct permissions on that feature class on the egdb?
@Joe-Borgione Thank you for your answer. I have DBO and Admin credentials I am the one who run the scripts. I use the Admin connection on the data will be updated.
database = r'\\nrdsmnt6\mine maps\DMP_Database\ShapefileProcessing_SupportFiles\Connection_DMP_Admin.sde'
Should I do something else? I can not use append tool here because there are read locks and I am unable to remove locks to switch "unregister as versioned".
Is the EGDB versioned? Where is stopOperation() and stopEditing(True)?
you may have luck with edit.startEditing(False, False)
Thanks a lot @David-Pike, I copied and pasted the wrong lines. duh! exactly, where is stopOperation() and stopEditing(True) I did not even notice I did not stop editing. That was the problem.