Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I am ashamed to ask: Variables
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00393489
Message ID:
00393816
Views:
15
Hi Rohanne & Cindy,

Suppose, you have a multiselect list (or multiselectgrid from Cetin Basoz), which allows a user to make selection criteria. Since I reconstruct where as a string expression anyway, I may use inlist + variables. Inlist function is limited by 24 codes, so I check how many codes were selected and then reconstruct criterion as couple of inlist function combained with and or or operator depending on Exclusion Flag. This technique works like a charm...

>>When there are nulls in the list, ANSI SQL-92 will always return the empty set. Rather than allowing the NOT IN syntax and risking this type of "surprise" result, FoxPro does not support the NOT IN syntax.
>>
>>To test for values that are NOT IN the list one should use the syntax:
>>
>>... WHERE NOT EXISTS ;
>>     (SELECT * FROM MyTable WHERE MyTable.Value = ValueImLookingFor)
>>
>>Randall was asking how to test for values that are "IN" not values that are "NOT IN".
>
>
>OK since we're on the subject here...
>Whenever I have a situation like Randall's or Nadya's where I want to check for existence/non-existence of a value in a list, I always try to work it out with a subquery like Cindy has shown here with either WHERE EXISTS or WHERE NOT EXISTS as appropriate. The reason being is both the SQL IN clause and VFP's INLIST function basically boil down to hardcoding.
>
>Back in VFP 5 I tried to get both INLIST() and IN() to work with variable values and never did get to work out. Anybody else know of a way to use either of these without hardcoding the list of values they use?
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform