From the course: Oracle Database 12c: Advanced SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Creating triggers

Creating triggers - Oracle Database Tutorial

From the course: Oracle Database 12c: Advanced SQL

Start my 1-month free trial

Creating triggers

- [Instructor] Let's see an example of how we can create a couple of table triggers in the Oracle database. We will start by creating two tables. Go into Exercise Files, let's copy the Create command, for both table1 and table2. Let's paste and execute these commands, in our SQL developer window. Table1 is the table in which we'll create our triggers, as part of the demo. Going to our Exercise Files, let's copy the Create or Replace Trigger command. Let's copy this command and paste it to our SQL developer window. Not that I'm executing a Create or Replace Trigger command. The "or Replace" means that if the trigger already exists in the database, then override it. I'm also providing a name for the trigger, test_trg1, in our case, and specifying that this trigger, should execute or fire, after Inserts on table1, which is the table we've just created. I'm also specifying that this trigger should execute for each row, that has been modified on table1. So, if I insert multiple rows, the…

Contents