>>>>> "Evan" == Evan Zane Macosko <macosko@fas.harvard.edu> writes:
Evan> Hi everyone, I'm wondering if someone could explain to me
Evan> how placeholders work with Perl DBI linking to Postgresql.
Evan> I seem to have trouble using them in a loop. For example,
Evan> the code:
Evan> my $i = 0; $sth = $dbh->prepare("UPDATE yeast1 set ? = '?'
Evan> where yeast1.orf = temp.orf"); while ($i<$#columns) {
Evan> $sth->execute($i, $tables[$i-1]; $i++; }
Evan> This returns an error from the Pg parser. Any suggestions?
Evan> Also, this query is incredibly slow--does anyone have
Evan> suggestions for optimization?
Placeholders are for values not for column names, and you shouldn't
have quotes around the ? either.
Sincerely,
Adrian Phillips
--
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now? [OK]