用触发器create or replace tirgger insert_tri before insert of username on tablea for each row begin insert into tableb(username) values(:new.username); end; /
create or replace trigger insert_tri after update or insert of username on Table_a for each row begin case when inserting then insert into Table_b(username) values(:new.username); when updating then update Table_b set username =:new.username ; end case; end;
before insert of username on tablea
for each row
begin
insert into tableb(username) values(:new.username);
end;
/
after update or insert of username on Table_a
for each row
begin
case
when inserting then
insert into Table_b(username) values(:new.username);
when updating then
update Table_b set username =:new.username ;
end case;
end;