H
Henri Baeyens
Hello,
I'm using DBI and an ODBC driver to get data from an Access database. The
query is executed but only part of the data is fetched. I know that the
database contains over 1500 rows. My query returns only 28 rows.
use DBI;
use strict;
use warnings;
my $dbh = DBI->connect('dbi:ODBC:boutique', {RaiseError => 1} );
my $query;
my $table = "articles";
my @row_array;
$query = $dbh->prepare("SELECT * FROM $table");
$query->execute;
while (@row_array=$query->fetchrow_array) {
foreach my $item (@row_array){
if ($item eq ""){
print qq~ NULL |~;
} else {
print qq~ $item |~;
}
}
}
my $numrows = $query->rows;
print qq~Number of rows fetched: $numrows~;
etc...
There's also the fact that columns are not fetched in the same order as
they are in the source database, but that's a minor problem.
I can't figure it out. Anything I am missing?
H
www.henribaeyens.com
I'm using DBI and an ODBC driver to get data from an Access database. The
query is executed but only part of the data is fetched. I know that the
database contains over 1500 rows. My query returns only 28 rows.
use DBI;
use strict;
use warnings;
my $dbh = DBI->connect('dbi:ODBC:boutique', {RaiseError => 1} );
my $query;
my $table = "articles";
my @row_array;
$query = $dbh->prepare("SELECT * FROM $table");
$query->execute;
while (@row_array=$query->fetchrow_array) {
foreach my $item (@row_array){
if ($item eq ""){
print qq~ NULL |~;
} else {
print qq~ $item |~;
}
}
}
my $numrows = $query->rows;
print qq~Number of rows fetched: $numrows~;
etc...
There's also the fact that columns are not fetched in the same order as
they are in the source database, but that's a minor problem.
I can't figure it out. Anything I am missing?
H
www.henribaeyens.com