Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: SET NEAR and integer seek
Message
 
 
To
11/06/2005 19:55:15
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01021240
Message ID:
01022541
Views:
16
Hi Olaf,

PMFJI. The behavior you describe has nothing to do with the range of the numeric data type. It's related to the character format in wich numeric fields are stored in a table. When FoxPro cannot fit all digits in the field it rounds the value and cuts some or all digits after decimal point.
Number	Stored value in the field
-9.99	'-9.99'
99.99	'99.99'
-99.99	' -100'
10000	'10000'
100000	'*****'
After '*****' stored in the field, increasing the field size is not going to help because original value is lost already.

>
>>"Out of range" definition - Out of range for the field type, not the particular >implementation. So although the field is limited to N(5,0), numerics aren't. Different >set of rules.
>
>Is that the same reason, why it's possible to store values out of range in N fields?
>
>
>CREATE CURSOR curNumber (nNumber N(5,2))
>INSERT INTO curNumber VALUES (-9.99)
>INSERT INTO curNumber VALUES (99.99)
>INSERT INTO curNumber VALUES (-99.99)
>INSERT INTO curNumber VALUES (10000)
>INSERT INTO curNumber VALUES (100000)
>BROWSE
>
>
>For me this gives a display of:
>
>-9.99 && as expected
>99.99 && as expected
>-100  && expected *****
>10000 && expected *****
>***** && as expected
>
>
>It seems every number with a length of 5 is accepted. Rounding -99.99 to -100 is a little surprise, as even -100 is not matching the 2 digits before the decimal point limit.
>
>If the field definition isn't really limiting values, I'd assume I could get at those values by altering the cursor, but that won't help:
>
>
>ALTER TABLE curNumber ALTER COLUMN nNumber N(6,2)
>
>Still the last value is *****.
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform