Drop a sequence

2024-04-19 08:42:50  Updated

You can use the DROP SEQUENCE statement to drop a sequence.

The SQL syntax for dropping a sequence is as follows:

DROP SEQUENCE [IF EXISTS] [database_name.]sequence_name;

Note that:

  • To execute this statement, you must have the DROP privilege.

  • If you specify IF EXISTS in the statement, no error is reported even if the sequence to be dropped does not exist. Otherwise, the system reports an error.

  • database_name specifies the database in which the sequence resides. If you do not specify database_name, the system takes by default that the sequence is in the current logon database.

For example, drop a sequence named S1.

obclient> DROP SEQUENCE S1;
Query OK, 0 rows affected

For more information about the DROP SEQUENCE statement, see DROP SEQUENCE.

References

For more information about operations on a sequence, see the following topics:

Contact Us