|Subject||Re: acces on old field value on after delete|
> old.* values are available in Update and Delete triggers.Hi Helen
> new.* values are available in Insert and Update triggers.
> >My reason I want to use the after delete is because I just want to
> >write a single trigger for after insert, after update and after delete
> Sure, but it will have to include conditional blocks according to the
> states of the Updating, Inserting and Deleting context variables.
I have this trigger for insert, update, delete. So far in my testing
everything work fine. In our statement above, do we a special variable
to know if the state is updating, inserting or deleting?
/* update po details serve qty */
set "Serve" = "Serve" - old."Qty"
where "Key" = old."PoID";
set "Serve" = "Serve" + new."Qty"
where "Key" = new."PoID";
/* udpate the inventory in the items */
set "Left" = "Left" - (old."Qty" * Old."Conversion")
where "ID" = old."ItemID";
set "Left" = "Left" + (new."Qty" * new."Conversion")
where "ID" = new."ItemID";
Iam wondering that are the values of old.field values in the insert
event and the values of the new.field values in the delete event. Is
it null? If null then the result of the update statement will null right?