Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Execute an SQL statement that is stored in a String?
Message
De
26/10/1999 17:55:15
 
 
À
23/10/1999 21:50:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00280480
Message ID:
00281899
Vues:
13
>
>You may collect the string(s) and then execute, e.g.
>cFieldstring="field1,fieldx"
>cFromstring="mytable"
>cWherestring="field1='qwerty'"
>cOrderstring="2"
>Select &cFieldstring. From &cFromstring. Into Cursor mycursor Where &cWherestring. Order by &cOrderstring.


Mauricio, the approach that Edward is suggesting is a good way to go. Note that there is a 256 (?) character limit on each macro expansion. That's why it's very helpful to devide up the various parts of the syntax.

I didn't understand this work around and so I wound up writing a number of different SQL statements which I choose with a case statement. Works OK, but the approach above is better. I'll redo my search forms some day.

Peter Robinson
Peter Robinson ** Rodes Design ** Virginia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform