Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL command too complex - what should I do?
Message
From
10/12/1999 19:08:17
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00301958
Message ID:
00302086
Views:
36
>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)
> 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?
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform