CREATE trigger tran_del_trig after delete on trans
REFERENCING old AS old_tran
FOR EACH ROW
BEGIN
If "old_tran"."tran_type" = 'R' Or
"old_tran"."tran_type" = 'T' Then
Update "product_master"
Set "product_master"."product_balance" =
"product_master"."product_balance" -
"old_tran"."tran_qty"
Where "product_master"."product_no" =
"old_tran"."tran_item_no"
Elseif "old_tran"."tran_type" = 'I' Then
Update "product_master"
Set "product_master"."product_balance" =
"product_master"."product_balance" +
"old_tran"."tran_qty"
Where "product_master"."product_no" =
"old_tran"."tran_item_no"
End If
END; |