Solved! Go to Solution.
Is this possible or do you have to delete one cursor before opening another?
Opening simultaneous insert and/or update operations on the same workspace using different cursors requires the start of an edit session.
Is this possible or do you have to delete one cursor before opening another?
Opening simultaneous insert and/or update operations on the same workspace using different cursors requires the start of an edit session.
import arcpy edit = arcpy.da.Editor(r'C:/Projects/GISPROD_ElectricDistribution_Extract.gdb') edit.startEditing(False,False) theIC = arcpy.da.InsertCursor(r'C:/Projects/GISPROD_ElectricDistribution_Extract.gdb/electric/servicepoint',['PHASEDESIGNATION', 'WORKORDERID', 'SUBTYPECD', 'PLACEMENTCONFIDENCE', 'SHAPE@']) theIC.insertRow(['7', '280773', '1', '90', arcpy.Point(292840.72313, 4818098.69548)]) edit.stopEditing(False)
RuntimeError: workspace already in transaction mode
with arcpy.da.InsertCursor('Points_Geom', ["PointID", 'SHAPE@XY']) as cursor: cursor.insertRow((123458, (4364181.91, 263840.13)))
cursor = arcpy.da.InsertCursor('Points_Geom', ["PointID", 'SHAPE@XY']) cursor.insertRow((123458, (4364181.91, 263840.13))) del cursor