Re: DBI placeholders - Mailing list pgsql-general

From Adrian Phillips
Subject Re: DBI placeholders
Date
Msg-id 87r8u5sbs7.fsf@grannyogg.localnet
Whole thread Raw
In response to DBI placeholders  (Evan Zane Macosko <macosko@fas.harvard.edu>)
Responses Re: DBI placeholders  (will trillich <will@serensoft.com>)
List pgsql-general
>>>>> "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]

pgsql-general by date:

Previous
From: Gayland Gump
Date:
Subject: macaddr data type issue
Next
From: Justin Clift
Date:
Subject: Re: macaddr data type issue