Purpose
This statement is used to drop a sequence.
Syntax
DROP SEQUENCE [IF EXISTS] [schema.]sequence_name
Parameters
| Parameter | Description |
|---|---|
| IF EXISTS | If this parameter is specified, an error is not returned when the sequence does not exist. Instead, a message is returned. This parameter is optional. |
| schema | The user who owns the sequence. If this parameter is not specified, the sequence of the current user is dropped by default. This parameter is optional. |
| sequence_name | The name of the sequence to be dropped. |
Examples
- Drop the
user_seqsequence.
obclient> DROP SEQUENCE user_seq;
- Drop the
product_seqsequence. If the sequence does not exist, do not return an error.
obclient> DROP SEQUENCE IF EXISTS product_seq;
