DBI placeholders

From: Evan Zane Macosko <macosko(at)fas(dot)harvard(dot)edu>
To: <pgsql-general(at)postgresql(dot)org>
Subject: DBI placeholders
Date: 2001-08-20 15:42:01
Message-ID: Pine.OSF.4.33.0108201137400.10434-100000@is01.fas.harvard.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-08-20 15:45:23 Re: Real newbie question.
Previous Message Justin Clift 2001-08-20 15:38:29 Re: Real newbie question.