in reply to Explanation of Code Problem
I think you're the OP is misunderstanding the use of placeholders here. Typically you would use placeholders like so
So it seems what you are trying to do is have a long list of placeholders and then specify the values to use for the placeholders sometime before the execute is called. You want the statement to have all the ? marks in it. It doesn't need to be re-prepped that way. (Part of the beauty of placeholders)my $sql = q{SELECT * FROM tblX WHERE condition = ?}; $sth = $dbh->prepare($sql); $sth->execute($value_to_sub_for_question_mark);
However to do what you are wanting i think you would do this
That is untested and you may need to put the array in list context, but i think that's your intent.. just a guessmy $sql = q{SELECT * FROM tblX WHERE condition1 = ? and condition2 = ? +}; my $sth = $dbh->prepare($sql); $sth->execute(@array);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Explanation of Code Problem
by Anonymous Monk on Jan 04, 2005 at 16:30 UTC | |
by Grygonos (Chaplain) on Jan 04, 2005 at 17:22 UTC | |
by Anonymous Monk on Jan 04, 2005 at 18:23 UTC | |
by Grygonos (Chaplain) on Jan 04, 2005 at 20:38 UTC | |
by Anonymous Monk on Jan 05, 2005 at 13:10 UTC |