I am trying to run a select statement to a sqlite3 database using Perl DBI. The following is the code:
my $dbh = DBI->connect( "DBI:SQLite:dbname=./GenBankData.db" , "" , "" , { PrintError => 0 , RaiseError => 1 } );
my $Sql = 'select AccessionQueryResultID, AccessionNumber, Definition from AccessionQueryResult';
my $sth = $dbh->prepare( $Sql ) or die "Couldn't prepare statement: " . $dbh->errstr;;
$sth->execute( $Sql) or die "Couldn't execute statement: " . $dbh->errstr;
But I am getting the following error: DBD::SQLite::st execute failed: called with 1 bind variables when 0 are needed at /home/mysite.cgi line 33
I have checked that the database and table exist and the same query works fine if I used the sqlite3 command line to run the query.
Thanks