This gives the errormy $date_file = new IO::File; $date_file->open("<start_date.txt") or die "cannot find file!"; chomp(my $date = $date_file->getline); $date_file->close; my $query = q{SELECT Count(x) AS numberOfx, y INTO temp_table FROM Referrals WHERE ((x Is Not Null) AND ([Today's Date]> ?)) GROUP BY x ORDER BY Count(x), y}; $sth = $dbh->prepare($query); $sth->execute($date); $sth->finish();
To me this was strange....so I decide to oblige the error and remove the bind variable to see if it expects one when I don't provide it. So I take $date out of the call to $sth->execute() and I get this errorDBD::ODBC::st execute failed: called with 1 bind variables when 0 are +needed at C:\Documents and Settings\xxx\Desktop\distribute.pl line 264.
Why does it expect one when I don't provide it, and not want one when I do? This is an odd error.. any ideas?DBD::ODBC::st execute failed: [Microsoft][ODBC Microsoft Access Driver +] Too few parameters. Expected 1. (SQL-07002)(DBD: st_execute/SQLExecute err=-1) + at C:\Doc uments and Settings\xxx\Desktop\distribute.pl line 264.
In reply to weird DBI error re: parameter binding by Grygonos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |