Pages

Search This Blog

Tuesday, 14 February 2012

AFTER INSERT TRIGGER IN ORACLE

When any insertion is made in the master table the changes will also be reflected in the slave table. This is done with a simple trigger.

Example

SQL> create trigger rep_trigger after insert on master
  2  for each row
  3  begin
  4  insert into slave(name) values(:new.name);
  5  end;
  6  /
master- table where trigger is placed
slave- table where changes are reflected
name - field name in both the tables

No comments:

Post a Comment