Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Values for SQL Server... still problems
Message
De
22/07/2004 09:48:28
 
 
À
22/07/2004 09:28:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00926896
Message ID:
00926979
Vues:
23

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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform