Peter Loo wrote:

Hi,

I am trying to pass an array reference to $sth->execute and I am
getting the following error:

DBD::ODBC::st execute failed: called with 38 bind variables when 0 are
needed at /usr/local/apps/common/devl/bin/GlobalRoutines.pm line 42.

The code I am using is as follows:

 sub sub_executeBind($$$) {
   local ($dbh, $sth, $bindVar) = @_;
   $sth->execute(@$bindVar) || die "$dbh::errstr";
   return($sth);
   }

Will someone please help me understand this error message?

Thanks in advance.

Peter

Peter Loo
Worldwide Consulting, Inc.
Phoenix, Arizona
U.S.A.



This would suggest there are no parameters in the SQL (i.e. no ? as
in "insert into table values (?)").

What does $dbh->{Statement}return - it should be the SQL you
are executuing.

Martin


Reply via email to