Subject | AFTER OR BEFORE ? |
---|---|
Author | Sergio H. Gonzalez |
Post date | 2008-06-30T19:42Z |
Hello, in this very simple trigger. It makes any difference to set it after
insert or before insert?
I think it doesn't but just want to make sure.
CREATE OR ALTER trigger stock_variaciones_ai0 for stock_variaciones
active after insert position 0
AS
begin
UPDATE STOCK
SET STOCK.CANTIDAD = STOCK.CANTIDAD + NEW.CANTIDAD
WHERE STOCK.ID = NEW.ID_STOCK;
end
insert or before insert?
I think it doesn't but just want to make sure.
CREATE OR ALTER trigger stock_variaciones_ai0 for stock_variaciones
active after insert position 0
AS
begin
UPDATE STOCK
SET STOCK.CANTIDAD = STOCK.CANTIDAD + NEW.CANTIDAD
WHERE STOCK.ID = NEW.ID_STOCK;
end