Inserting and updating rows inside an edit session

As I've mentioned throughout the chapter, inserts, updates, or deletes made to a table or feature class done outside an edit session are permanent. They can't be undone. Edit sessions give you much more flexibility to roll back any unwanted changes.

Getting ready

Up until now, we've used insert and update cursors to add, edit, and delete data from feature classes and tables. These changes are permanent as soon as the script is executed and can't be undone. The new Editor class in the data access module supports the ability to create edit sessions and operations. With edit sessions, changes applied to feature classes or tables are temporary until permanently applied with a specific method call. This ...

Get Programming ArcGIS with Python Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.