Grygonos has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: weird DBI error re: parameter binding
by jeffa (Bishop) on Jul 30, 2003 at 17:06 UTC | |
by Grygonos (Chaplain) on Jul 30, 2003 at 17:17 UTC | |
by tye (Sage) on Jul 30, 2003 at 17:50 UTC | |
by Grygonos (Chaplain) on Jul 30, 2003 at 19:14 UTC | |
by tye (Sage) on Jul 30, 2003 at 19:21 UTC | |
| |
|
Re: weird DBI error re: parameter binding
by skyknight (Hermit) on Jul 30, 2003 at 16:56 UTC | |
by Grygonos (Chaplain) on Jul 30, 2003 at 17:11 UTC |