Subject | Re: [firebird-support] trigger not firing? |
---|---|
Author | Mark Rotteveel |
Post date | 2018-09-25T15:50:04Z |
On 25-9-2018 16:49, shg_sistemas@... [firebird-support] wrote:
possible, but that should - in most cases - still produce errors.
more efficient (and simpler to read in my opinion)
--
Mark Rotteveel
> Hello! I use FB 2.5. I know that this its almos imposible, but just inHave you checked if the trigger is still active, maybe it was disabled?
> 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 warehouseIn the face of bugs or a corrupted database, of course anything is
> 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?
possible, but that should - in most cases - still produce errors.
> CREATE OR ALTER trigger stock_ai5 for stockNot related to your problem, but using insert ... select is probably
> 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
more efficient (and simpler to read in my opinion)
--
Mark Rotteveel