Purpose
You can use this statement to drop a sequence.
Required privileges
To execute the DROP SEQUENCE statement, you must have the DROP privilege. For more information about privileges in OceanBase Database, see Privilege types in MySQL mode.
Syntax
DROP SEQUENCE [IF EXISTS] [schema. ] sequence_name;
Parameters
| Parameter | Description |
|---|---|
| schema. | The schema where the sequence resides. If schema. is not specified, the sequence is located in the schema of the currently logged-in user. |
| IF EXISTS | Specifies to display prompt information if the sequence does not exist, without returning an error. |
| sequence_name | The name of the sequence to be dropped. |
Examples
Drop the seq1 sequence.
obclient> DROP SEQUENCE IF EXISTS seq1;
Query OK, 0 rows affected