|Subject||RE: [firebird-support] numeric value is out of range|
|Author||Marianne Castel - Titelive|
I’ll read the documentation again (for this). At migration time, I saw that we didn’t have fields with numeric definition… and i passed that section. But i didn’t noticed that we had “numeric” in our stored procedures…. And I fall on it now.
Great thanks ! I go back to documentation J
The definition of numeric calculation was changed between dialect 1 and 3 with Interbase 6. This is described in the Interbase 6 getting started (available from the website).
Basically in dialect 1 this type of division overflowed into double precision, it doesn't in dialect 3 and your result doesn't fit and it raises an arithmetic overflow.
I try to figure out why i have a problem in my database since i convert it from firebird 1.5 (dialect 1, no charset ) to firebird 2.5 (dialect 3 and defined charset to utf8).
The following SQL failed in the new database (fb 2.5 dialect 3). It worked in fb 1.5 (dialect 1).
---->>>> Even if i try to cast the result in a numeric value. ---> That's what i do not understand.
I can understand that a numeric divided by another numeric can give a float... but why the cast does'nt work ?
cast(8975.00038147 as numeric(18,8)) / cast(1.06 as numeric(18,8))
- the values 8975.0038147 come from is a field value. field definition is float.
p>- the problem that i actually have occured in a procedure where there is a computed variable.
CA_BRUT_HT = :CA_BRUT_TTC_fact / :TAUX_TVA;
where the three variables are defined as numeric (18,8).
But ibexpert show me the SQL that give the problem (the select i pasted in this mail).
What's the best to do ? working with float variables ?
Thanks in advance for the light you can give me with that problem.