Thanks Mike for a new approach to making SQL readable. I've never used your approach and will want to compare it to what I have been doing at some point. Joe
On Saturday, December 01, 2007 11:02 AM, Mike yearwood wrote: > >Date: Sat, 1 Dec 2007 11:02:03 -0500 >From: Mike yearwood >To: [EMAIL PROTECTED] >cc: >Subject: Re: Execscript glitch? > >Hi Joe > >> Message: 2 >> Date: Fri, 30 Nov 2007 20:36:44 -0500 >> From: Joe Yoder <[EMAIL PROTECTED]> >> Subject: re: Execscript glitch? >> To: [EMAIL PROTECTED] >> Message-ID: <[EMAIL PROTECTED]> >> Content-Type: text/plain; charset="us-ascii" >> >> Thanks Gianni and Lew, >> >> I guess that's one reason to use Execscript instead of macro >> substitution. I was trying to figure out if there were any advantages >> beyond the elegance of a one liner. >> >> I went back to the help but didn't find anything to indicate that an >> array created there would not be accessible in the following code. Is >> there a clue I am missing or am I just supposed to know?? >> > >There is nothing inherently elegant about a one liner. They tend to >become harder to read and maintain. I rarely, if ever, use execscript. >I would not use it for a single SQL command, but to execute multiple >commands. A UDF is better in most cases because you can unit test it >before plugging it in to your app. > >To do SQL commands I use TEXT...ENDTEXT to make the SQL readable, >maintainable, extensible and then execute it with macro substitution. > >TEXT TO m.lcSQL TEXTMERGE NOSHOW > SELECT ; > addresses.add_pk, ; > <<THIS.icSnippetFullName>> AS member ; > FROM ; > <<THIS.icDataSource>> Addresses ; > LEFT JOIN MEMBERS ON Addresses.UID = Members.UID ; > LEFT JOIN addresses oldaddresses on addresses.previousadd_fk = >oldaddresses.add_pk >ENDTEXT > >&lcSQL. > > [excessive quoting removed by server] _______________________________________________ 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.

