Delete Database Sequence (Data Management)

Summary

Deletes a database sequence from a geodatabase.

Usage

  • This tool can be used with file geodatabases and geodatabases in IBM Db2, Microsoft SQL Server, Oracle, PostgreSQL, and SAP HANA.

  • You can use the ListDatabaseSequences function to get a list of database sequences in a file geodatabase. This allows you to confirm the sequence name and review sequence properties before deleting it.

Parameters

LabelExplanationData Type
Input Workspace

The full path to the location of the file geodatabase from which you want to delete a sequence or the database connection file (.sde) to connect to the enterprise geodatabase from which you want to delete a sequence. The user specified in the database connection must have the following permissions in the database:

  • Db2—DBADM authority
  • Oracle—Must be the sequence owner or have the DROP ANY SEQUENCE system privilege
  • PostgreSQL—Must be the sequence owner
  • SAP HANA—Must be a standard user
  • SQL Server—ALTER OR CONTROL permission on the database schema where the sequence is stored

Workspace
Sequence Name

The name of the database sequence you want to delete. Once deleted, the sequence cannot be used to generate sequence IDs when called from existing custom applications or expressions.

String

Derived Output

LabelExplanationData Type
Deleted sequence from geodatabase

The updated input workspace.

Workspace

arcpy.management.DeleteDatabaseSequence(in_workspace, seq_name)
NameExplanationData Type
in_workspace

The full path to the location of the file geodatabase from which you want to delete a sequence or the database connection file (.sde) to connect to the enterprise geodatabase from which you want to delete a sequence. The user specified in the database connection must have the following permissions in the database:

  • Db2—DBADM authority
  • Oracle—Must be the sequence owner or have the DROP ANY SEQUENCE system privilege
  • PostgreSQL—Must be the sequence owner
  • SAP HANA—Must be a standard user
  • SQL Server—ALTER OR CONTROL permission on the database schema where the sequence is stored

Workspace
seq_name

The name of the database sequence you want to delete. Once deleted, the sequence cannot be used to generate sequence IDs when called from existing custom applications or expressions.

String

Derived Output

NameExplanationData Type
out_workspace

The updated input workspace.

Workspace

Code sample

DeleteDatabaseSequence example (Python window)

Delete the custom_sequence database sequence from an enterprise geodatabase.

import arcpy
arcpy.DeleteDatabaseSequence_management(r"C:/myconnections/mygdb.sde", 
                                        "custom_sequence")
DeleteDatabaseSequence example (Python window)

Delete the my_ids sequence from a file geodatabase named myfilegdb.

import arcpy
arcpy.DeleteDatabaseSequence_management(r"C:/geodatabases/myfilegdb.gdb", 
                                        "my_ids")

Environments

Licensing information

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics