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.
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.
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.