Hi Tom,
> What is the field definition for the field that is overflow? If I run
the
> below in VFP 7 SP2 and VFP 9 SP2 the field definition in curTmp3 for f2
is
> N(6,3).
>
> If I change f2 to integer in curTmp2 then in curTmp3 the field is
N(11,0).
>
> This I thought was odd 555.355 for row "C" is 555.36 and I cannot enter
> three decimal places in the table, is this normal behavior? I do not
think I
> have seen that before in my 15 years of using FoxPro.
>
> CREATE CURSOR curTmp2(f1 C(1), f2 N(6,3))
>
> INSERT INTO curTmp2 (F1,F2) values("C",555.355)
That's the way foxpro (may be also ancient dBase/foxbase) handles numeric
data
when it exceeds the defined field size.
You insert a number that is larger than the definition allows, since it
has 7
places. So foxpro stores the number and cuts (rounds) the decimal places
but
keeps the places before the decimal point. If you
INSERT INTO curTmp2 (F1,F2) values("C",-555.355)
then it would store -555.4
Other DB systems would throw an error in both cases.
Regards
Bernhard Sander


|