Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing a parameter to th IN clause
Message
 
 
À
20/07/1999 14:36:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00243695
Message ID:
00243862
Vues:
30
Paige:

I have tried in vain to get this to work with local and remote views. The problem is with the parameter being a character string. VFP won't remove the delimiters [i.e., the extra set of quotes] from around the string passed. This is why it works if you let VFP prompt you for the parameter list -- no extra set of quotes. If you have just 1 value in the string it works. When you have to pass more than 1, the extra set of quotes and the comma screw it up.

Now if you create the SQL programmatically to create a cursor, you can do it, but what a pain in the posterior that is if you really need an updatable view.

An example I gave was:

where State in ?cStateList

or

where State in (?cStateList)

or

where State in ( ?cStateList )

None of which worked for me. If I initialize the value of cStateList, I get no records returned if I initialize it to more than 1 State. If I let VFP prompt me for the value, it works. I have initialized the parameter a number of ways, including:

cState = "'AR','LA'"
cState = "('AR','LA')"
cState = 'AR' + "," + 'LA'
... , etc.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform