Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL with SubQuery, incorrect unfiltered result set
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00142708
Message ID:
00142742
Views:
21
There were definitely some problems with FP 2.x using logical fields in SELECT statements. The best thing to do is to always use lField=.T. or lField=.F. instead of lField or !lField.

>I'm encountering something weird in FPW26.
>I tried it in VFP60 and there it works as I expect.
>
>A sipmle SELECT with a filtered subquery.
>
>Like:
>select * from where IN (select from where inactive)
>
>Where as Inactive is a field of type logical.
>
>In the contrary to my expectations I get codes from the that shouldn't be in there due to the filtered subquery.
>Here it seems that FoxPro takes the original table instead of the filtered SubQuery, such FoxPro's way of optimizing.
>
>When the query is executed as follows, forcing Fox to create a cursor:
>
>select * from where IN (select from where inactive AND .T.)
>
>I get the expected filtered result set.
>Also when doing it like this:
>
>select * from where IN (select from where inactive = .T.)
>
>Anybody a clue if this is a Fox2.6 bug or if it has something to do with a setting we overlooked.
>ThanX.
Previous
Reply
Map
View

Click here to load this message in the networking platform