Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Building a SQL statement on the fly
Message
From
10/09/1999 22:44:54
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00263324
Message ID:
00263594
Views:
34
Hi William,

Since you're interested in what others have done... I ran into the same problem when building SQL statement on the fly to use in SPT. What I did to work around was use STRTOFILE() to gather all of the syntax, and then FILETOSTR() when I passed it to SQL. Worked for me.

Take Care

>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform