Enable Trigger

This Article will help you to understand “Enable Trigger” with examples and it’s detailed description.

Sometimes you will found that the trigger is DISABLED and you need to ENABLE it again. ALTER TRIGGER statement used to enable trigger.

For better understanding we will create table “test_data”. Then create trigger “trg_test_enable” on test_data table.

We will check the trigger status from “USER_TRIGGERS” table. This table contains all details about triggers.

Then we will ENABLE trigger by ALTER TRIGGER statement and then check again the USER_TRIGGERS table and check the status of this trigger.

Examples
Code
Output
table TEST_DATA created.
Output
TRIGGER TRG_TEST_ENABLE compiled

When you create triggers, they will be ENABLED by default. To learn DISABLE trigger, Please refer DISABLE TRIGGER

TRIGGER_NAME STATUS
TRG_TEST_ENABLE DISABLED
Output
trigger TRG_TEST_ENABLE altered.

Now again check the status of trigger.

TRIGGER_NAME STATUS
TRG_TEST_ENABLE ENABLED
References
  1. Syntax :- Oracle official docs
  2. Enabling triggers :- Oracle official docs
  3. 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 *