Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
? in update command
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00574234
Message ID:
00574259
Vues:
95
This message has been marked as the solution to the initial question of the thread.
You can still use the same code but you'll have to remove '?' from the generated SQL command. Something like
s = STRTRAN( s, "?", "")
assuming that you dont have '?' somewhere in the string literals inside it.

>Sergey,
>
>x and z are local and the SQL string is built up and then executed via &s. I hadn't thought of just using the variable names - I'll try it, thanks. I was hoping to use the same code that I send to my ODBC source in my VFP-only routines - things get very awkward with memo fields containing chr(13/10) but the '?' syntax solves that very neatly for the ODBC source, hence my hopes for VFP.
>
>Many thanks,
>
>RJL
>
>[Update] Yes you are right although I have to enclose the variable-name in brackets else I get a 'column not recognised' error.
>Thanks again
>
>>Hi Robert,
>>
>>I think it works only in SELECT statement to make the view parameters possible. Why do you need it in VFP at all? Your example works fine w/o '?' character.
>>x = 'ole biscuit'
>>z=99
>>s = "update wibble set ftang=x where pk=z"
>>&s
>>
>>
>>>When I use
>>>
>>>x = 'ole biscuit'
>>>z=99
>>>
>>>s = "update wibble set ftang=?x where pk=?z"
>>>
>>>in ODBC it works fine, but if I try this in VFP, via &s or as a direct statement, I get a syntax error. In SELECT it works correctly. Can I NOT do this in VFP but only in ODBC?
>>>
>>>Many thanks
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform