At 04:37 PM 5/1/2008 +0000, Mark Stanton wrote:
>Whilst the ExecScript thang is a great idea, my client's batch simply
>doesn't work like that at the moment 8-(

I'm sorry, I don't understand the above comment. Code structure, content, 
etc, is not dependent on a "batch" run or a "real time" run. Of course, 
some code is more effective under one environment or another, but that 
doesn't have anything to do with the discussion.

You wanted a certain result set. You have a given database design. You can 
see the easy solution by using perhaps 2 separate SQL statements. We've 
explained to you a couple options that would easily accommodate multiple 
SQL statements.

Are you saying you do not control how the memo field is interpreted? In 
other words, are YOU writing the code that reads the memo field that 
contains the SQL statement(s). If you are, then simply change the call to 
use EXECSCRIPT() instead of what you're doing now (which is... parsing? 
macro substitution?). If all the other memo fields are currently simple SQL 
statements, the EXECSCRIPT() should flow them through with no problem.

If you're not in control of the code that 'reads' the memo field, I'd 
suggest you work out an additional interface spec with whomever is. For 
example, the code they use now may grab the SQL String and "parse" out the 
field list, and "parse" out the WHERE clause and "parse" out the FROM... 
JOIN... etc. And then they rebuild the whole thing again into a SQL 
statement (I've actually done something similar back in VFP 6 days). Well, 
simply tell them if see EXECSCRIPT() in the first characters of the string, 
strip out "EXECSCRIPT()" and then take the rest of the string and put it 
inside an EXECSCRIPT() call.

The thing is, once you get the use of EXECSCRIPT() in place, you are 
assured to be able to EASILY handle ANY monstrously complex data processing 
need in the future (as long as the database content can support it). And, 
on top of that, the complex stuff you have to do will take much less effort 
to maintain in the future. I think you can even sprinkle comments in the 
content of the string that goes through EXECSCRIPT() and it won't hurt 
things. Imagine that - a fully commented code block to explain all the 
things the code is doing. SQL syntax is truly a step back to the dark ages 
in that regard.

-Charlie



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to