Comment Re:Construct the array and placeholders in paralle (Score 1) 117
my $col_a_criteria = ' AND COLUMN_A IN (' . join(",", ('?') x @bind) . ') ' if scalar @bind;
$sth->prepare("select column_B from my_table where column_z = ? $col_a_criteria");
scalar @bind ? $sth->execute($col_z, @bind) : $sth->execute($col_z);
# It also wouldn't hurt to make sure that you are not exceeding the max SQL length or max values in an IN clause...
$sth->prepare("select column_B from my_table where column_z = ? $col_a_criteria");
scalar @bind ? $sth->execute($col_z, @bind) : $sth->execute($col_z);
# It also wouldn't hurt to make sure that you are not exceeding the max SQL length or max values in an IN clause...