Subject Re: [firebird-support] [FB 1.5] Integer Overflow bug?
Author Ivan Prenosil
This is shorter:

SELECT CAST(1e0*V1*V2*V3 AS NUMERIC(18,4)) FROM TEST;

Ivan


"Fabricio Araujo" wrote:
> The only way I got it to run is like it:
>
> select cast(cast(v1 as double precision)*cast(v2 as double
> precision)*cast(v3 as double precision) as numeric(18,4)) from teste
>
> Too much write for so little.....
>
> On Tue, 4 Jan 2005 15:21:14 +0100, Ivan Prenosil wrote:
>
>>
>>> CREATE TABLE TEST (
>>> V1 DECIMAL(18,4),
>>> V2 DECIMAL(18,4),
>>> V3 DECIMAL(18,4)
>>> );
>>>
>>> INSERT INTO TEST (V1, V2, V3) VALUES (10000000, 1, 1);
>>>
>>> SELECT V1*V2*V3 FROM TEST
>>>
>>> The select statement generate an unespected INTEGER OVERFLOW
>>
>>Resulting type of your multiplication is DECIMAL(18,12)
>>(because you use exact numerics), and as you can see,
>>the value 10000000 does not fit in.
>>
>>Ivan