Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Building a SQL statement on the fly
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00263324
Message ID:
00263745
Views:
23
>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)
Previous
Reply
Map
View

Click here to load this message in the networking platform