Subject ODP: [firebird-support] trigger not firing?
Author Karol Bieniaszewski
It depend how you table sto_depositos is populated and when you set activo=1?

Pozdrawiam,
Karol Bieniaszewski

Od: shg_sistemas@... [firebird-support]
Wysłano: wtorek, 25 września 2018 16:49
Temat: [firebird-support] trigger not firing?

 
Hello! I use FB 2.5. I know that this its almos imposible, but just in case I ask. Is there any chance that a trigger is not firing at all?

I have this very simple trigger to create one record for each warehouse in the "stock" table. But I've found that quite a lot of articles (in the stock table) doesn't have its records in the "sto_cantidades" table. 

It is possible that some kind of corruption causes that? or should I chek my entire code and see if that records are somehow being deleted?

thanks!!

CREATE OR ALTER trigger stock_ai5 for stock
active after insert position 5
AS
declare variable loc_id fk_id;
begin
  for select id from sto_depositos where activo = 1 into :loc_id do
  begin
     insert into sto_cantidades (id_stock, id_sto_depositos, cantidad) values (new.id, :loc_id, 0);
  end
end





[Non-text portions of this message have been removed]