Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Building a SQL statement on the fly
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00263324
Message ID:
00263745
Vues:
22
>It would never (I know, never say never) exceed 254 fields, but the macro substituted variable containing the field list does on occasion exceed 254. What I did was create an array of 10 elements. As I go to add to the string that is macro expanded, I check to see if it will exceed the 254 limit. If it does, I go to the next element in the array and start adding to it. Then in my SQL statement, I macro expand each element. The elements that don't have any value expand to '' since I initialize them that way. I just thought it was kludgy, but it seems the only way given the limitation of a len of a command executed with Macro substitution.
>

Yep... so, have you tried to build your select statment into a tring then eval it? For example... you had your lcFields and lcWhere... do this...

lcSelect = 'SELECT '+lcFields+' FROM '+lcTables+' WHERE '+lcWhere
EVAL(lcSelect)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform