Trigger to notify changes
When a new employee is registered, the sector is not informed. The field is null. After,the sector is registered. How do I verify the change?
My trigger is this:
if (:old.unid_lot is null)
then
if (:new.unid_lot is not null)
then
select ds into lot_new
from setor
where cd = :new.unid_lot;
strmensagem := 'Employee : ' ||:new.nom||utl_tcp.CRLF;
strmensagem := strmensagem || 'Sector : '||lot_new||utl_tcp.CRLF;
prc_email('xxx@xxxx.XXXX', 'New Employee',strmensagem);
end if;