Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized SQL PassThrough Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00329981
Message ID:
00330074
Vues:
18
<>

>This is a know problem [at least by me] that you can not parameterize an IN() clause. If your mcProg parameter just has 1 values in it, it will work. The problem is in having to have quotes around each value. There is no way to just pass '000609','000172','001113' without addition surrounding double-quotes. Now if you do not predefine the value of mcProj, and let VFP prompt you for the list, it will work with more than 1 value.
>
>The only way to get it to work with variables, is to build the list of values:
>cSQL = "......." ;
>         + "where .... IN ('" + mcProg1 + "', '" + mcProg2 + "') ..."
>
>I believe, IN (&mcProg.) will also work.

Thanks Mark. I can't do the first option because the number of choices is variable but the macro substitution worked great. John K. gave me the same suggestion on a similar thread but it wouldn't work. There must have been something else wrong with my SELECT that the error message wasn't alluding to.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform