On Wed, Oct 08, 2003 at 09:48:56AM -0700, David Wheeler wrote: > On Wednesday, October 8, 2003, at 08:55 AM, Ragnar Hojland Espinosa > wrote: > > > > >Hi David, hm.... i thought i had mentioned it too.. but that doesnt > >work either: > > > >my $sth = $dbh->prepare ("INSERT INTO emails (id, fromhdr, subjecthdr, > >datehdr, wholemessage, plaintext) VALUES (?, ?, ?, ?, ?, ?);") || die > >"$|"; > > > >$sth->bind_param (5, $wholemessage, { pg_type => DBD::Pg::PG_BYTEA }); > > > >$sth->execute ($id, $from, $subject, $date, $wholemessage, > >$plain_text->string) || die "$|"; > > That's because you're binding it twice. You need to bind each argument > with bind_param(), and then call execute() without any arguments.
That shouldn't be needed according to the DBI spec. The type set by a previous bind_param() is 'sticky' and so applies to the later execute(). Tim.