Re: ODP: ODP: [firebird-support] trigger not firing?

2018-09-25 Thread shg_siste...@yahoo.com.ar [firebird-support]
Nope... :(  

 So, do you think that no database corruption can make this to happen?
 

 I have two options here: the former... or I have a very hidden bug which I 
didn't found yet which is deleting those missing records... just in case, I 
created an "after delete" trigger to log any possible deletion... will see...
 

 Sergio

 



ODP: ODP: [firebird-support] trigger not firing?

2018-09-25 Thread Karol Bieniaszewski liviusliv...@poczta.onet.pl [firebird-support]
>>The table "sto_depositos" (it means warehouses) is populated entering all the 
>>warehouses manually. 
>>It barely changes. 

Then when it is changing you can have situation like this?

Transaction 1 start
Transaction 2 start
Tranaction 1 change sto_depositos
Transaction 2 manipulate data and fire that trigger, which do not see 
modification from Transaction 1 as it is not commited yet.
Transaction 2 commit;
Transaction 1 commit;

As you can see, you can loose records…
I do not know if this is in your case..

Regards,
Karol Bieniaszewski


Re: ODP: [firebird-support] trigger not firing?

2018-09-25 Thread shg_siste...@yahoo.com.ar [firebird-support]
Thanks Karol!! 

 The table "sto_depositos" (it means warehouses) is populated entering all the 
warehouses manually. It barely changes. The "activo" field is used to hide some 
warehouse I'm not longer using...
 

 Sergio


Re: ODP: [firebird-support] trigger not firing?

2018-09-25 Thread shg_siste...@yahoo.com.ar [firebird-support]
Thanks for the answer!

 > It depend how you table sto_depositos is populated and when you set activo=1?
 

 The table is populated by this trigger, and the "activo" field doesn't change 
(almost) ever!!! I'ts use only if I want to hide a warehouse that is not used 
anymore...
 

 Sergio.



ODP: [firebird-support] trigger not firing?

2018-09-25 Thread Karol Bieniaszewski liviusliv...@poczta.onet.pl [firebird-support]
It depend how you table sto_depositos is populated and when you set activo=1?

Pozdrawiam,
Karol Bieniaszewski

Od: shg_siste...@yahoo.com.ar [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]