Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing a parameter to th IN clause
Message
 
 
To
20/07/1999 14:36:33
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00243695
Message ID:
00243862
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform