Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use IN clause in VFP
Message
 
À
29/01/2002 11:22:30
Lakhani Anil
Lakhani Software Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00609547
Message ID:
00612234
Vues:
35
What you are trying to do is one of the problems with the view designer. However it is possible to create a view through code that will do want you want.
Here is a simple example that will work.


* Create the view with the parameterized string
CREATE SQL VIEW "MyView" ;
AS SELECT * FROM temp!item WHERE item IN (&?lcString)


* Now to run the view
* Concat all indiviual parameters as a string
lcString = "'00002','00003','00009'"

USE MyView
SELECT MyView
BROWSE

The downside to this approach is that when you try to modify the view in the view designer, you get a Syntax Error. This is the reason why we don't use view designer, instead we create all database objects through code and save the code as part of the project. If we need to modify the view, then we can modify it in the code and recreate the view.

Hope this helps.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform