Delete Field (Data Management)

Deletes one or more fields from a table of a feature class, feature layer, and/or raster catalog.


Usage tips

Syntax

DeleteField_management (in_table, drop_field)
Parameter Explanation Datatype
Input Table (Required)

The table containing the field that is to be deleted. The existing Input Table will be modified.

Table View | Raster Layer
Drop Field (Required)

The field, or fields, to be dropped from the Input Table. Only non-required fields may be deleted.

The Add Field button, which is used only in ModelBuilder, allows you to add expected field(s) so you can complete the dialog and continue to build your model.

Field
Data types for geoprocessing tool parameters

Script Example

import arcgisscripting
gp = arcgisscripting.create()

# Set a default workspace
gp.workspace = "c:\\test_data"

# Set a default workspace
gp.toolbox = "management"

try:
    # Delete fields from this shapefile.
    gp.deletefield ("soils.shp", "slope; loam")

except:
    # If an error occurs when running Deletefield, print out the error message.
    print gp.GetMessages(2)

See Also

  • Add Field (Data Management)
  • Add Item (Coverage)
  • Drop Item (Coverage)