-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrigger_backup_2.sql
More file actions
34 lines (29 loc) · 961 Bytes
/
trigger_backup_2.sql
File metadata and controls
34 lines (29 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
create or replace trigger t_backup_ljc
after insert or update or delete on jaechuldb2
for each row
begin
if inserting then
insert into jaechuldb2@ljc(idx, name, age)
values(:new.idx, :new.name, :new.age);
-- insert into jaechuldb@pyj(name, age)
-- values(:new.name, :new.age);
-- insert into jaechuldb@jhn(name, age)
-- values(:new.name, :new.age);
elsif updating then
update jaechuldb2@ljc
set age = :new.age,
name = :new.name
where idx = :old.idx;
-- update jaechuldb@pyj
-- set age = :new.age
-- where name = :old.name;
-- update jaechuldb@jhn
-- set age = :new.age
-- where name = :old.name;
elsif deleting then
delete jaechuldb2@ljc where name = :old.idx;
-- delete jaechuldb@pyj where name = :old.name;
-- delete jaechuldb@jhn where name = :old.name;
end if;
end;
/