Subject | Re: [ib-support] Wrong calculations inside trigger (next try) |
---|---|
Author | WM |
Post date | 2003-05-26T08:07:07Z |
Thanks for fast answer!
calculation results and data fields. Example I send without that, sorry.
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.
new.ilosc are not 0.0, and not null, and posted to other table to control
values - so I can say that calculation fails.
> This is almost certainly a precision problem involving rounding on resultsBut, first thing I do, was typecasting - to exact the same types in
> 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.
calculation results and data fields. Example I send without that, sorry.
> Also, it is not clear from your code whether, in the dividend expression,It is not division error. Errorouneus is wrong value new.cena * new.ilosc,
> you expect the addition or the multiplication to be performed first. Add
> some brackets to make this clear.
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 theCalculation new.cena * new.ilosc sometimes are equal to 0.0 - new.cena,
> calculations "fail"?
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