Hi Garrett

That's cool getting the && out. Could you not do everything from the
&& to the end of the line? Since you are calling regexp already, can
you remove the chr(10), chr(9), chr(13), leading spaces and ; all with
a single RegExp?

Thanks

Mike Yearwood

> Message: 8
> Date: Wed, 4 Jun 2008 11:30:06 -0400
> From: "Garrett Fitzgerald" <[EMAIL PROTECTED]>
> Subject: SQL Passthru and long commands
> To: [EMAIL PROTECTED]
> Message-ID:
>        <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="us-ascii"
>
> 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, "")


_______________________________________________
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