[freetds] perl DBI update with parameters

Dirk Koopman freetds at tobit.co.uk
Thu Jul 14 14:58:57 EDT 2005


Consider this simulation of a much larger program:-

my $stm = q(update foo set a=?,b=? where c=? and d=?);

my $sth = $dbh->prepare($stm);

my @field = qw(foo bar);
my @keys = qw(jim pat);

$sth->execute(@field, @key);

Seems to be giving me errors in the execute complaining about there
being more parameters required by the $stm than where provided by the
the $sth->execute (although sometimes it is the other way around).

Looking at the debug trace, I believe I am preparing a statement as
shown and the data passed to the execute, the no of parameters add up to
the same no of '?' in the $stm. 

This seems only to happen for update sql statements, insert statements
work just fine. I am using DBD::ODBC, unixodbc and freetds 0.62.4. 

Any suggestions as to where to start looking?

Dirk





More information about the FreeTDS mailing list