in reply to "You passed 0 parameters where 1 required" error using DBD::CSV, an INNER JOIN, and a WHERE clause

Digging deeper, I remembered that this message has had some code changes around it. Most notable this, which was done by me.

The chang log tells me:

=head2 Changes in DBI 1.609 (svn r12816) 8th June 2009 Fixes to DBD::File (H.Merijn Brand) added f_schema attribute table names case sensitive when quoted, insensitive when unquoted workaround a bug in SQL::Statement (temporary fix) related to the "You passed x parameters where y required" error

That sure sounds related!

It is however nice to note the intertwined relations here. That change was submitted to DBD::File, but the code seems to have been moved to DBI::DBD::SqlEngine (see sub execute in that file) in more recent DBI versions. If you replace

unless ((my $req_prm = $stmt->params ()) == (my $nparm = @$params)) +{ my $msg = "You passed $nparm parameters where $req_prm required" +; $sth->set_err ($DBI::stderr, $msg); return; }

with

unless ((my $req_prm = $stmt->params ()) == (my $nparm = @$params)) +{ my $msg = "You passed $nparm parameters where $req_prm required" +; warn $msg; }

you essentially revert to what it was before 2009. Still wrong, but you might find a fix.

/me digs on. If I find something, I'll add that here.


Enjoy, Have FUN! H.Merijn
  • Comment on Re: "You passed 0 parameters where 1 required" error using DBD::CSV, an INNER JOIN, and a WHERE clause
  • Select or Download Code