Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple select that doesn't work..
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01173935
Message ID:
01174046
Views:
7
<snip>

>As Cetin said SET ANSI controls this in SELECT statements and SET EXACT and the == operator control it in VFP code. Here are the rules for string comparison;

The SET ANSI controls comparison in all SQL sattements: SELECT, DELETE, UPDATE

>Default: (SET ANSI OFF and SET EXACT OFF) The string on the left is compared one char at a time with the string on the right until the string on the right is exhausted, then the result is returned.

It's correct only for VFP code. In the SQL statements the comparison is done to the length of the shorter string regardless if it's on the left or the rigth of the = operator.

<snip>

>The == operator: The string on the left is compared one char at a time with the string on the right until the string on the right is exhausted, then the two strings are compared for length and the result is returned.

It's correct only for VFP code. In the SQL statements it works the same as SET ANSI ON, the shorter string is padded with spaces to the length of the longer one before comparison.

>
>SET ANSI and SET EXACT are NOT the same as using == as can be seen in the following;

Yes, SET ANSI is the same as ==
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform