The DROP TRIGGER statement is used to drop a trigger.
Syntax
DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name
Parameters
| Parameter | Description |
|---|---|
| IF EXISTS | Optional. If the trigger does not exist, it will not generate an error but will generate an alert. |
| schema_name | Optional. The name of the database where the trigger is located. If omitted, the trigger will be dropped from the default database. |
| trigger_name | The name of the trigger to be dropped. |
The DROP TRIGGER statement requires the TRIGGER privilege on the table associated with the trigger.
If a table is dropped, its triggers are also dropped.
Examples
Drop a trigger.
obclient> DROP TRIGGER IF EXISTS test_trg;
Drop a trigger from a specified database:
obclient> DROP TRIGGER IF EXISTS test_db.before_employee_insert;
