O'Reilly logo

Programming ArcGIS 10.1 with Python Cookbook by Eric Pimpler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deleting rows with an UpdateCursor

In addition to being used to edit rows in a table or feature class, an UpdateCursor can also be used to delete rows. Please keep in mind that when rows are deleted outside an edit session, the changes are permanent.

Getting ready

In addition to updating records, UpdateCursor can also delete records from a table or feature class. The UpdateCursor object is created in the same way in either case, but instead of calling updateRow(), you call deleteRow() to delete a record. You can also apply a where clause to UpdateCursor, to limit the records returned. In this recipe, we'll use an UpdateCursor object that has been filtered using a where clause to delete records from our FireIncidents feature class.

How to do it… ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required