Ms.No One
Ms.No One

Reputation: 1

Create PL/SQL Trigger based on last update date of different views table

Is it possible to create a Trigger based on the last update date of different views? The one that triggers inserting entire employee and dept records in new table when last_update_date changed/updated?

ex views:

CREATE OR REPLACE FORCE VIEW "EMPLOYEE_V" AS
   SELECT employee_id
         ,employee_first_name
         ,employee_last_name
         ,emp_creation_date 
         ,emp_last_update_date 
     FROM employees;

CREATE OR REPLACE FORCE VIEW "DEPARTMENT_V" AS
   SELECT department_id
         ,department_name
         ,dep_creation_date 
         ,dep_last_update_date 
     FROM department_id;

I know that this will require 1 trigger which will apply to both tables. But is there an alternative way to avoid several updates / update of records when the trigger in both tables have been fired?

Any help will be appreciated. Thanks :)

Upvotes: 0

Views: 152

Answers (1)

NIRMAL K M
NIRMAL K M

Reputation: 17

One trigger can't be created on multiple tables. You need to create two different triggers for each underlying tables. Thanks..

Upvotes: 1

Related Questions