22 of 62
ucreate or replace trigger v_customer_iu
uinstead of update on v_customer
ubegin
u update customer set name_tx  = :new.name_tx
u where cust_id = :old.cust_id;
u
u if :old.addr_id is not null
u and :new.street_tx is null then
u  delete from address where addr_id=:old.addr_id;
u elsif :old.addr_id is null
u and :new.street_tx is not null then
u  insert into address(…) values (…);
u else
u  update address set… where addr_id=:old.addr_id;
u end if;
uend;
INSTEAD-OF Update