Subject | Re: [Firebird-Java] numeric(15,2) and number of decimal places |
---|---|
Author | Helen Borrie |
Post date | 2007-02-28T00:35:05Z |
This reply is an interpolation - it's not attempting to answer the
Java driver question....
At 06:46 AM 28/02/2007, you wrote:
significant digits, scale is the number of digits to the right of the d.p.
I expect that your Java drivers have been doing something interesting
in the past with your fields defined as numeric(15,2), since IB 5.6
does not support numeric or decimal with precision greater than 9
(well, it will stretch to 10 for some numbers without overflowing).
If you are using your IB 5.6 databases under a Firebird 1.5 server
then they will still be IB 5.6 databases, i.e. ODS 9.1, SQL Dialect
1. If you restored an IB 5.6 gbak backup under Firebird 1.5.x then
the databases will be ODS 10.1 but the dialect will still be
1. Either way, your client applications must connect as Dialect 1 clients.
Not also that restoring your ODS 9.1 databases into ODS 10.1 does
*not* convert the data to be ODS 10.1 data. This will affect fixed
numerics particularly, if you succeed in connecting as a Dialect 3
client. Your original field definition and your data will be in
conflict with each other, as you can observe from the left shift of
the decimal point. However the Java driver handles it in the
application layer, the stored data will continue to be "wrong" until
you put it right.
Helen
Java driver question....
At 06:46 AM 28/02/2007, you wrote:
>Hello,You mean, too much scale. Precision is the maximum number of
>
>Recently we upgraded our interbase 5.6 servers to firebird 1.5. We seem
>to have issues with fields we have declared as numeric(15,2).
>Previously in interbase using interclient/java these fields would get
>pulled out of the database and correctly have 2 places after the decimal
>point. Now with jaybird/java even though the field is still declared as
>numeric(15,2) the java gets too much precision (too many numbers on the
>right of the decimal point).
significant digits, scale is the number of digits to the right of the d.p.
I expect that your Java drivers have been doing something interesting
in the past with your fields defined as numeric(15,2), since IB 5.6
does not support numeric or decimal with precision greater than 9
(well, it will stretch to 10 for some numbers without overflowing).
If you are using your IB 5.6 databases under a Firebird 1.5 server
then they will still be IB 5.6 databases, i.e. ODS 9.1, SQL Dialect
1. If you restored an IB 5.6 gbak backup under Firebird 1.5.x then
the databases will be ODS 10.1 but the dialect will still be
1. Either way, your client applications must connect as Dialect 1 clients.
Not also that restoring your ODS 9.1 databases into ODS 10.1 does
*not* convert the data to be ODS 10.1 data. This will affect fixed
numerics particularly, if you succeed in connecting as a Dialect 3
client. Your original field definition and your data will be in
conflict with each other, as you can observe from the left shift of
the decimal point. However the Java driver handles it in the
application layer, the stored data will continue to be "wrong" until
you put it right.
Helen