Richard Kaye wrote:
> If you're using VFP 8 or 9, check out the PRETEXT option in the 
> TEXT..ENDTEXT command. It will remove all the white space for you. Also, 
> you could dump the semi-colons, although that would make it harder to 
> maintain your inline comments. Having said that, TSQL also supports 
> inline comments so you could work around that by changing && to --. I 
> also find the TEXTMERGE & ADDITIVE options very useful.
> 
> Garrett Fitzgerald wrote:
>> I mentioned earlier this year that I was using tricks when building
>> statements to send through SQL passthru. I just ran across the
>> following one, and figured I'd share FWIW.
>>
>> I put lcQueryFormat on the first page of the report: then I strip
>> everything out that the server's going to choke on.
>>
>> TEXT TO lcQueryFormat NOSHOW
>> SELECT Person.searchName, Person.patientId, Person.dateOfBirth ;
>>      SNIP ;
>>      FROM ml.Person Person ;
>>              SNIP ;
>>              LEFT JOIN ml.Problem ON Person.pID = Problem.pID ;
>>                      AND (Problem.code LIKE 'ICD-578.9%' ;   && GI bleeding 
>> &&
>>                              OR Problem.code LIKE 'ICD-599.7%' ;     && 
>> Hematuria &&
>>                              OR Problem.code LIKE 'ICD-924.9%' ;     && 
>> Hematoma &&
>>                              OR Problem.code LIKE 'ICD-432.9%' ;     && 
>> Intracranial hemorrhage &&
>>                              OR Problem.code LIKE 'ICD-287.9%' ;     && 
>> Bleeding disorder &&
>>                      )
>> ENDTEXT
>>
>> lcQueryFormat = CHRTRAN(lcQueryFormat, ";", "")
>>
>> lcQuery = CHRTRAN(lcQueryFormat ;
>>                      , CHR(9) + CHR(10) + CHR(13) ;
>>                      , " ")
>> lcComment = "&" + "&"        && For obvious reasons...
>> lcQuery = RegExp(lcQuery, lcComment + "[^&]+" + lcComment, 1, "")
>>
>>   
> 

Maybe I'm not getting the point. You are having trouble sending long SQL 
commands using SQL passthrough? I solve that by having the SQL command 
in a memo field (in a table or a cursor created to hold the command) and 
feeding the memo field directly to SQLExec(). I'm currently working with 
select statements in excess of 5 A4 pages when printed. For comments I 
use "--" (I send the commands to SQL Server) and don't strip them.

HTH




_______________________________________________
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