Jacopo Cappellato wrote:
> Daniel, Dag,
>
> thanks for your answers: they are really helpful.
>
> Well, right now we are now using NUMERIC(18,2) field types for currency
> amount fields... so that values are stored in the db with the exact
> number of decimal we need (0k, we are actually in the process of
> reviewing this approach).
>
> Do you think we should use a different field type? (e.g. DECIMAL)
DECIMAL and NUMERIC are the same in Derby. So it looks like you are
using the correct type. One option is to increase the scale of the
number (digits after the decimal point), e.g. NUMERIC(20,4) which would
then hold two extra digits that would be lost in the assignment to
NUMERIC(18.2). Maybe this is what you meant by approximation, the
ability to control the rounding as Dag said?
Dan.
[
The SQL standard allows DECIMAL (I think) to have greater precision than
defined while NUMERIC must match its defined precision.
]
