The DROP TRIGGER statement is used to drop a trigger.
Syntax
DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name
Parameters
Parameter |
Note |
|---|---|
| IF EXISTS | Optional. If the trigger does not exist, no error is reported; only an alert is generated. |
| schema_name | Optional. The name of the database where the trigger is located. If omitted, the trigger is 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 you delete a table, its triggers are also deleted.
Examples
Delete a trigger.
obclient> DROP TRIGGER IF EXISTS test_trg;
Drop a trigger in a specified database:
obclient> DROP TRIGGER IF EXISTS test_db.before_employee_insert;