SQL call formatting style

David Miller justdave at syndicomm.com
Tue Mar 25 23:26:11 UTC 2003


On 3/25/03 5:56 AM -0500, Jake wrote:

> Myk Melez wrote:
>
>> (queries with strings that may have newlines in them can't be easily
>> stripped of newlines with s/\s+/ /g).
>>
> In my brief testing, it also collapses newlines.

if you do s/\s+/ /gs (note the s on the end) it'll remove newlines.

What you want to be careful of is what if you have a quoted string which
contains multiple spaces within the query?  you don't want to remove the
spaces from the content of the string....

On the other hand, if we're using placeholders we shouldn't have to worry
about that because there won't be anything quoted in the query itself.
-- 
Dave Miller      Project Leader, Bugzilla Bug Tracking System
http://www.justdave.net/             http://www.bugzilla.org/



More information about the developers mailing list