Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL command too complex - what should I do?
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00301958
Message ID:
00302100
Views:
33
Ed,
>>>I'm afraid, it's too difficult. And also I know, that UDFs in SQL could
>>1) slow down the speed
>>2) work unpredictable (it could work in one situation and not work in another).
>>
>
>Take a look at my more recent answer of building the entire SELECT into a .PRG, compiling it and running it.
>
>> We have to find simpler solution. On Monday will be our programmer's meeting, so we'll discuss.
>> I think, it's a general situation, so, if you already have a working example and can share with us, it would be great.
>>
>
>If you can build the SQL Select now using macro-expansion, simply concatenate the whole thing together in a single string and use STRTOFILE() to write it to disk. Compile the file you write using STRTOFILE(). Execute the compiled code. Something like:
>
>
cMyEntireSQLCommand = 'SELECT '+ cMySelectMacro + ;
>   ' ' + cMyJoinExpression + ;
>   ' ' + cMyWhereExpression + ;
>   ' ' + cMyIntoClause + ;
>   ' ' + cMyGroupByExpression + ;
>   ' ' + cMyOrderByExpression
>*  make it as complex as you like
>cMyPrgFile = SYS(2015) + '.PRG'
>= STRTOFILE(cMyEntireSQLCommandAsAString,cMyPrgFile)
>COMPILE (cMyPrgFile)
>DO (cMyPrgFile)
Great! And not too much difficult, as I was afraid. I really appreciate your help. Thanks much.

>> BTW, I ask about VFP7.0. Do you know, when will MS release this product? Will this annoying limitation be fixed in the new version?
>>
>> I can write a long list of desired improvements in VFP (actually, I did it once). Should I? And where do I need to post it? In chatter section?
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform