Re: Using q() to define a query
- From: victorchurchill@xxxxxxxxx (Victor Churchill)
- Date: Fri, 11 Jan 2008 12:14:03 +0000
Hi,
On 11/01/2008, Colin Wetherbee <cww@xxxxxxxxxxxxxxxx> wrote:
(As an aside, how do you guys quote your queries? I find that for
anything longer than about 60 characters, q() and '' and everything else
start to look horribly inelegant.)
Can't comment on your main question, but on the secondary query-layout
topic, I find this works quite nicely:
$query2 = qq/SELECT MTR_REFERENCE FROM ALLOCATED_METERS,METERS /;
$query2 .= qq/WHERE ALM_MTR_ID = MTR_ID /;
$query2 .= qq/AND ALM_LP_ID = ( /;
$query2 .= qq/ SELECT LP_ID /;
$query2 .= qq/ FROM LOGGER_POINTS,ALLOCATED_METERS,METERS /;
$query2 .= qq/ WHERE LP_ID=ALM_LP_ID /;
$query2 .= qq/ AND MTR_ID=ALM_MTR_ID /;
$query2 .= qq/ AND MTR_REFERENCE = ? ) /;
(In a mono font the right hand /;'s align, for neatness, but that's optional).
Nice thing doing it this way is that it does not confuse the editor's
auto indent.
.
- Follow-Ups:
- Re: Using q() to define a query
- From: Tim Bunce
- Re: Using q() to define a query
- References:
- Using q() to define a query
- From: Colin Wetherbee
- Using q() to define a query
- Prev by Date: Re: Using q() to define a query
- Next by Date: Re: Using q() to define a query
- Previous by thread: RE: Using q() to define a query
- Next by thread: Re: Using q() to define a query
- Index(es):