Drop Trigger

DROP TRIGGER statement drops a database trigger from the database.

Example

We will create table “demo_data”. Then create trigger “trg_drop_example” on demo_data table.

We will check the trigger status from “USER_TRIGGERS” table.

Then we will DROP the trigger and then check again the USER_TRIGGERS table. No records will be found from USER_TRIGGERS after DROP the Trigger.

Note:- USER_TRIGGERS table contains data related to all triggers and status of trigger.

Code
Output
table DEMO_DATA created.
Output
TRIGGER TRG_DROP_EXAMPLE compiled
TRIGGER_NAME STATUS
TRG_DROP_EXAMPLE ENABLED
Output
trigger HR.TRG_DROP_EXAMPLE dropped.

In DROP TRIGGER statement, we specified schema name before trigger name. If you don’t specify schema name, then database will assume that the trigger is in your own schema.

Now again check the status of trigger.

no rows selected.
References
  1. Syntax :- Oracle official docs
  2. PL/SQL Triggers :- Oracle official docs
It's good to share...Share on FacebookTweet about this on TwitterShare on LinkedInPin on PinterestShare on Google+Email this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *