On Thu, 18 Apr 2002, Krung Saengpole wrote:
> I think you can generate how many placeholder in the statement if there are
> non-fixed criteria. e.g.
>
> foreach (@criteria){ # @criteria is entry list
> $stm .= "," if $stm;
> $stm .= "?";
> }
>
> in the query:
>
> ...->prepare("Select * from table where field in ($stm)");
> $sth->execute(@criteria);
>
> HTH
> Krung.
>
Instead of using a loop to construct $stm, an alternative would be:
chop($stm='?,' x @criteria);
**** [EMAIL PROTECTED] <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs