Subject | Re: [firebird-support] Re: NUMERIC and DECIMAL |
---|---|
Author | Thomas Miller |
Post date | 2005-10-04T16:51:21Z |
It shouldn't in 2.0, but when I would add up all the order for a month
in Firebird / Interbase
and then do it in Oracle, Firebird/Interbase would always be wrong.
Orders of
123.45
3243.51
2345.3
About 20 of them and do a query like
select customer_number, SUM(order_total)
from mytable
group by customer_number
Worked great in Oracle, and always failed in Firebired.
Ann W. Harrison wrote:
Thomas Miller
Wash DC Delphi SIG Chairperson
Delphi Client/Server Certified Developer
BSS Accounting & Distribution Software
BSS Enterprise Accounting FrameWork
http://www.bss-software.com
http://www.cpcug.org/user/delphi/index.html
https://sourceforge.net/projects/uopl/
http://sourceforge.net/projects/dbexpressplus
in Firebird / Interbase
and then do it in Oracle, Firebird/Interbase would always be wrong.
Orders of
123.45
3243.51
2345.3
About 20 of them and do a query like
select customer_number, SUM(order_total)
from mytable
group by customer_number
Worked great in Oracle, and always failed in Firebired.
Ann W. Harrison wrote:
>Thomas Miller wrote:--
>
>
>>Isn't this a bug???? NUMERIC should never store more precision. No
>>wonder SUM never works.
>>
>>
>
>Certainly the standards says that a NUMERIC field should never accept a
>value larger than the specified precision. And here's a recent test
>done on a dialect 3 V2.0 database:
>
>
>SQL> show table foo;
>F1 NUMERIC(3, 2) Nullable
>F2 NUMERIC(6, 2) Nullable
>F3 NUMERIC(10, 3) Nullable
>F4 DECIMAL(3, 2) Nullable
>F5 DECIMAL(6, 2) Nullable
>F6 DECIMAL(10, 3) Nullable
>SQL>
>SQL> insert into foo values (
>CON> 10.01, 10101.01, 10101010.001,
>CON> 10.01, 10101.01, 10101010.001);
>SQL> commit;
>SQL> select * from foo;
>
>F1 10.01
>F2 10101.01
>F3 10101010.001
>F4 10.01
>F5 10101.01
>F6 10101010.001
>
>But why do you say that behavior affects SUM?
>
>Cheers,
>
>
>Ann
>
>
>
>
>
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Visit http://firebird.sourceforge.net and click the Resources item
>on the main (top) menu. Try Knowledgebase and FAQ links !
>
>Also search the knowledgebases at http://www.ibphoenix.com
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
Thomas Miller
Wash DC Delphi SIG Chairperson
Delphi Client/Server Certified Developer
BSS Accounting & Distribution Software
BSS Enterprise Accounting FrameWork
http://www.bss-software.com
http://www.cpcug.org/user/delphi/index.html
https://sourceforge.net/projects/uopl/
http://sourceforge.net/projects/dbexpressplus