Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized IN
Message
 
 
À
22/04/2009 20:56:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01396004
Message ID:
01396051
Vues:
85
You've to use a combination of SPT parameter and macrosubstitution.
lcEmpList = ["NAME1","NAME2"]
lcQuery = "SELECT * FROM myTable WHERE employee IN (?&lcEmpList)"
lnRetval = SQLEXEC(lnConnection, lcQuery, "crsResult")
I moved a query out for clarity.

>
SQLEXEC(lnConnection,"SELECT * FROM myTable WHERE employee = ?emp")
>
>pops up a little dialog box and allows entry of a name to search against.
>
>I want to use the same functionality with IN
>
>
SQLEXEC(lnConnection,"SELECT * FROM myTable WHERE employee IN (?emp)")
>
>If I put in
NAME1,NAME2
I get nothing back
>If I put in
"NAME1","NAME2"
I get just the first record
>
>How can I format the dialog response (or how else can I set up the query) to get the two (or any number of) names
>
>(I'm sure there are lots of other ways of doing this, but all I'm really interested in is how to do this with the parameterized query.)
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform