Hi Guys
I am using two CSV files as DB with DBD::CSV Driver.
I used the following code to run a Select query.
-------------------------
$dbh = DBI->connect("DBI:CSV:f_dir=/amd/homes/banni/PI/DB")
or die "Cannot connect: " . $DBI::errstr;
$table='etl';
$dbh->{'RaiseError'} = 1;
$@ = '';
eval {
$query = "SELECT playercode,playername FROM $table";
$sth = $dbh->prepare($query);
$sth->execute();
$sth->execute();
while ($sth->fetchrow_arrayref()) {
print("Found result row: @$_\n");
}
$fields = $sth->{NUM_OF_FIELDS};
print "Fields = $fields\n";
$sth->finish();
};
----------------------
Assume the table(file 'etl') contains the following data
playercode,playername
1,Apple/iPod/iPhone
2,Leap Frog/Leapster
3,Microsoft Zune
4,Mylo
I am able to fetch the number of fields here. But while i use $sth->fetchrow_arrayref, the rows are not fetched. Tried using fetchrow_array and fetch functions too. And the sad thing I didn't any error messages too:(
Please help me to solve this problem
Thanks in advance