Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Values for SQL Server... still problems
Message
From
22/07/2004 09:48:28
 
 
To
22/07/2004 09:28:20
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00926896
Message ID:
00926979
Views:
25

You can see the update statement @P2 the value is 1049


I was sure of this. This is another bug.

The field is N(8,0)?

The value in VFP is 1050?

The implementation of N(x, y) has a sea of problems.

1. When VFP use N(x, y) values for computations, it convert the values into a B(y) value.
Then,
You cannot execute the same calculation in VFP and SQL Server and expecting for the same result to you.
In Practice VFP it does not support the Decimal() data type.

2. It remembers to you that N(x, y) is not a SQL Decimal(x, y):
clear
CREATE CURSOR testN ( nn N(5,2)) && this is a 4 digits or 1 sign + 3 digits value, with max 2 decimals
append blank
? "valid values"
REPLACE nn WITH 10.23
? nn	&& 4 digits
REPLACE nn WITH 1234
? nn	&& 4 digits
REPLACE nn WITH -123
? nn	&& 3 digits + 1 sign
REPLACE nn WITH -1.23
? nn	&& 3 digits + 1 sign

? "not valid values"
REPLACE nn WITH -1.233
? nn	&& max 2 decimals
REPLACE nn WITH 100.23
? nn	&& max 4 digits
REPLACE nn WITH -10.23
? nn	&& max 1 sign and 3 digits
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform