On Mon, 27 Sep 2004 12:26:03 -0700, Jeff Zucker wrote:

>> my $SQL = "select * from students where id in (@ids)";
>
>Instead use:
>
>   my $SQL = 'SELECT * FROM students WHERE id NOT IN ('
>           . join ',' , @ids
>           . ')'
>           ;
>
>Because a) you want NOT IN and b) The values inside the parens of the IN 
>predicate must be comma-separated.

Temporarily (using local) setting $" to ",", and using code like his
original code, seems simpler to me. But, TIMTWOWTDI.

        local $" = ',';
        my $SQL = "select * from students where id not in (@ids)";

-- 
        Bart.

Reply via email to