Subject Re: [ib-support] Numeric (18,0) problem
Author Helen Borrie
At 07:54 PM 17-09-02 -0500, you wrote:
>Hi,
>I'm using Firebird 1.0 with Delphi 6 UP2; my problem relates with BCD data
>and I donĀ“t know if the problem resides on Delphi or Firebird, so I'm sorry
>if my post is not 100% Firebird related and If you can help me, I'd
>appreciate very much.
>
>I have a table field defined as Numeric(18,0) in Firebird 1.0.

It's a Delphi problem...and a db design error.

You should use a scaled numeric or a floating point type for BCD
data. Numeric (18,0) is a 64-bit integer. BCD is going to try to make
this into a scaled type of (22,4) which will cause overflow both in Delphi
and Firebird. Conversely, there is no point in using a BCD type for an
integer datatype.

Also, if you are trying to use the BDE, you are probably going to encounter
more problems with Dialect 3. The InterBase 6 driver shipping with BDE 5.2
is fairly buggy with respect to the new datatypes.

Consider moving away from the BDE to one of the connectivity solutions
available for FB/IB and Delphi - IB Objects, FIBPlus, IBX or SQLDirect,
albeit any Delphi solution is going to give you problems if you use BCD for
integers.

heLen