Subject Re: [ib-support] Wrong calculations inside trigger (next try)
Author WM
Thanks for fast answer!

> This is almost certainly a precision problem involving rounding on results
> which are less than 1. Tell us more about all of the *database* data types
> involved in the calculation, and someone will be able to show you why you
> are getting zero for the results.

But, first thing I do, was typecasting - to exact the same types in
calculation results and data fields. Example I send without that, sorry.

> Also, it is not clear from your code whether, in the dividend expression,
> you expect the addition or the multiplication to be performed first. Add
> some brackets to make this clear.

It is not division error. Errorouneus is wrong value new.cena * new.ilosc,
which always is not 0.0 (not null too) really - but after calculation
sotemtimes is equal to 0.0. I put this calculation first (before division),
use other syntaxes but problem is still the same.
Essentially problem is, that when result of this calcylation is not 0.0
everything goes good. In one moment it starts to be 0.0 and it starts to be
very often. In the same trigger, other calculations, posts are OK. When I
restart database serwer etc. calculations starts to be ok.

> Are you getting division-by-zero errors? If not, then in what way do the
> calculations "fail"?

Calculation new.cena * new.ilosc sometimes are equal to 0.0 - new.cena,
new.ilosc are not 0.0, and not null, and posted to other table to control
values - so I can say that calculation fails.

> heLen