DBI placeholders - Mailing list pgsql-general

From Evan Zane Macosko
Subject DBI placeholders
Date
Msg-id Pine.OSF.4.33.0108201137400.10434-100000@is01.fas.harvard.edu
Whole thread Raw
Responses Re: DBI placeholders
List pgsql-general
Hi everyone,


I'm wondering if someone could explain to me how placeholders work with
Perl DBI linking to Postgresql.  I seem to have trouble using them in a
loop.  For example, the code:

my $i = 0;
$sth = $dbh->prepare("UPDATE yeast1 set ? = '?' where yeast1.orf =
temp.orf");
while ($i<$#columns) {
    $sth->execute($i, $tables[$i-1];
    $i++;
}

This returns an error from the Pg parser.  Any suggestions?  Also, this
query is incredibly slow--does anyone have suggestions for optimization?

Thanks!
Evan



pgsql-general by date:

Previous
From: bend@ITstuff.net (John Bend)
Date:
Subject: Re: Cant compile using stock RH71 and libpq++
Next
From: Evan Zane Macosko
Date:
Subject: Re: Real newbie question.