Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Varchar Bug ?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01061404
Message ID:
01061408
Views:
11
It's not a bug but documennted behavior. "When SET ANSI is set to OFF, the two strings are compared character for character until the end of the shorter string is reached". The empty value in the first record myVarCharField field will match any value specified on the right side of the "=" operator.
>CREATE CURSOR myCursor (myVarCharField V(10),myCharField C(10), MyRecno I)
>INSERT INTO myCursor (myVarCharField, myCharField, MyRecno) VALUES ("","",1)
>INSERT INTO myCursor (myVarCharField, myCharField, MyRecno) VALUES ("?","?",2)
>INSERT INTO myCursor (myVarCharField, myCharField, MyRecno) VALUES (" "," ",3)
>
>SELECT * FROM mycursor WHERE myVarCharField = "?"
>*-* Select record 1 and 2
>
>SELECT * FROM mycursor WHERE myCharField = "?"
>*-* Select record 2
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform