Is there any way to use a cursor to delete a field using ArcPy?
I understand there are ways to use a cursor to delete records but I'm looking for a way to delete a field using a cursor.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
No. You cannot use a cursor to delete a field from the schema of a table or feature class.
Cursors are used to view or edit data, not to alter the schema.
As @MichalStimson commented, you will need to use
arcpy.DeleteField_management() to delete a field, and this cannot be done while there is an active cursor due to the cursor's lock on the table.