Help for this page

Select Code to Download


  1. or download this
    my @ids_to_match = ( ... );
    my $query = "SELECT somedata from table WHERE id IN ("
    ...
    my $sth = $dbh->prepare($query);
    
    $sth->execute(@ids_to_match);
    
  2. or download this
    my $query = "SELECT somedata from table WHERE id IN ("
        . join(",", map { $dbh->quote($_) } @ids_to_match )
    ...
    my $sth = $dbh->prepare($query);
    
    $sth->execute();