i have a problem in understanding the concept which i read ill jus give the snippet code
[CODE=oracle]create trigger WORKER_LODG_MAN AG_update
instead of UPDATE on WORKER_LODG_MAN AG
for each row
begin
if :old.name<>:new .name
then
update WORKER
set name=:new.name
where name=:old.name;
end if;
if :old.lodging<>: new.lodging
then
update WORKER
set lodging=:new.lo dging
where name=:old.name;
end if;
if :old.manager<>: new.manager
then
update LODGING
set manager=:new.ma nager
where lodging=:old.lo dging;
end if;
end;[/CODE]
then if i have a command UPDATE WORKER set lodging='bangal ore' where name='bart'; which would cause INSTEAD OF trigger to get exectued
now i dont understand why in the INSTEAD OF trigger i have a comparison condition for name if :old.name<>:new .name then ..... end if; because i have to check for names thats bart only
please help me know the reason or let me know if i have to make the question still more clearer
[CODE=oracle]create trigger WORKER_LODG_MAN AG_update
instead of UPDATE on WORKER_LODG_MAN AG
for each row
begin
if :old.name<>:new .name
then
update WORKER
set name=:new.name
where name=:old.name;
end if;
if :old.lodging<>: new.lodging
then
update WORKER
set lodging=:new.lo dging
where name=:old.name;
end if;
if :old.manager<>: new.manager
then
update LODGING
set manager=:new.ma nager
where lodging=:old.lo dging;
end if;
end;[/CODE]
then if i have a command UPDATE WORKER set lodging='bangal ore' where name='bart'; which would cause INSTEAD OF trigger to get exectued
now i dont understand why in the INSTEAD OF trigger i have a comparison condition for name if :old.name<>:new .name then ..... end if; because i have to check for names thats bart only
please help me know the reason or let me know if i have to make the question still more clearer
Comment