-----Original Message-----
From:   Bart Lateur [mailto:[EMAIL PROTECTED]
Sent:   Fri 10/29/2004 7:34 PM
To:     [EMAIL PROTECTED]
Cc:     
Subject:        Re: Perl Question: 
On Fri, 29 Oct 2004 17:18:20 -0600, Reidy, Ron wrote:

>Or (from Bart Lateur):
>
>>   my $SQL = 'SELECT * FROM students WHERE id NOT IN ('
>>           . join ',' , @ids
>>           . ')'
>>           ;

> I'd only ever do that for numerical id's. For the generic case, I4d use
> placeholders, like anybody else here. (or wouldn't you?)

Of course I would use placeholders.  I didn't mention it because I feel like maybe I 
sound like a broken record sometimes, repeating the obvious.

> Simply replace
>
>       join ',', @ids
>
>with
>
>       join(',', ('?') x @ids)
>
> or with
>
>       join(',', map '?', @ids)
>
> and call execute() with @ids as parameter provider.
>
> -- 
>       Bart.




This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is intended 
to be for the use of the individual or entity named above. If you are not the 
intended recipient, please be aware that any disclosure, copying, distribution 
or use of the contents of this information is prohibited. Please notify the
sender  of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.

Reply via email to