Subject rounded decimal on Triggers
Author monalisa
Hi All,
I have odd problem need help ! I have table with this field :

jml1 double
jml2 double
jmltot double

I want that JMLTOT=JML1*JML2. so I make trigger before insert and update :

CREATE TRIGGER STOCKALL FOR STOCK

BEFORE UPDATE AS

BEGIN


NEW.JMLTOT=NEW.JML1*NEW.JML2;

END

END !!

SET TERM ;!!

they running well for somedays, but suddenly they make rounded the value itself

example : JML1 = 4, JML2 = 4.2 => JMLTOT =16

The actual value is 16.8 Its works good at first, but after somedays the problem come again.

I think the problem is on the double type. So I change JMLTOT to numeric(15,2).

The same rule happend again. For view days, it work allrigth, but after 3-4 days, the same problem came again.

There's any rule I miss ? I use Interbase 6.0

Thanks All !

Regard,

MONA.






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