5-13. Creating a Trigger in a Disabled State

Problem

After a planning meeting, your company has decided that it would be a great idea to create a trigger to send notification of updates to employee salaries. Since the trigger will be tied into the system-wide database application, you want to ensure that it compiles before enabling it so that it will not affect the rest of the application.

Solution

Create a trigger that is in a disabled state by default. This will afford you the opportunity to ensure that the trigger has compiled successfully before you enable it. Use the new DISABLE clause to ensure that your trigger is in DISABLED state by default.

The following trigger sends messages to employees when their salary is changed. The trigger is ...

Get Oracle and PL/SQL Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.