12-11. Creating a Trigger

Problem

You need to create a DML database trigger that validates data prior to inserting it into a table, and you want to use Oracle SQL Developer to do so. For instance, you want to create a trigger that will validate an e-mail address prior to inserting a row into the EMPLOYEES table.

Solution

Use the Create Trigger Wizard, type the PL/SQL trigger code into a SQL worksheet, or use the trigger options that are available from the database table worksheet. To start the wizard, go to the File menu and select the New option. Once the Create a New dialog box opens, select Trigger. This will open the Create Trigger window, as shown in Figure 12-34.

Figure 12-34. Creating a new trigger

The Create Trigger window simplifies ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.