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 - Oracle Database Tutorial
From the course: Oracle Database 12c: Advanced SQL
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Introduction to sequences2m 8s
-
(Locked)
Creating sequences7m 6s
-
(Locked)
Using identity columns7m 23s
-
(Locked)
Introduction to table triggers3m 1s
-
(Locked)
Creating triggers5m 24s
-
(Locked)
Introduction to PL/SQL procedures3m 55s
-
(Locked)
Introduction to PL/SQL functions1m 21s
-
(Locked)
Introduction to PL/SQL packages2m 21s
-
(Locked)
Creating PL/SQL procedures and functions7m 40s
-
(Locked)
Creating synonyms4m 24s
-
(Locked)
Creating simple views2m 24s
-
(Locked)
Creating complex views5m 13s
-
(Locked)
-
-