Skip Menu |

This queue is for tickets about the DBIx-Dump CPAN distribution.

Report information
The Basics
Id: 5400
Status: new
Priority: 0/
Queue: DBIx-Dump

People
Owner: Nobody in particular
Requestors: hoummw [...] qzip.net
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: DBIx-Dump
This is the error that I get when I run the perl script below. I am tring to write to an excel file. Let me know what I am doing wrong. Version of Modules That Are Installed DBI 1.37 DBIx-Dump 0.04 DBD-mysqlPP 0.03 SpeadSheet-WriteExcel 0.42 ERRORS: Filename required by Spreadsheet::WritExcel->new() at D:/Perl/site/lib/DBIx/Dump.pm line 48 (in cleanup) Cant use an undefind value as a HASH reference at D:/Perl/site/lib/Spreadsheet/WriteExcel/Workbook.pm line 553. Can’t call method “addworksheet” on an undefined value at D:/Perl/site/lib/DBIx/Dump.pm line 51. Here is a copy of my perl script. #!D:/perl/bin/perl use DBI; use Spreadsheet::WriteExcel; use DBIx::Dump; ### Perform the connection using the Mysql Driver. my $dbh = DBI->connect("DBI:mysqlPP:database=db1;host=localhost", "root","mysql") or die "Can't make connect to the database: $DBI::errstr\n"; my $sql=("select * from table1"); $sth = $dbh->prepare($sql); $sth->execute(); $out = DBIx::Dump->new('format' => 'excel', 'ouput' => 'db.xls', 'sth' => $sth,); $out->dump(); $dbh->disconnect or warn "Disconnect failed: $DBI::errstr\n"; exit; OPERATIONS SYSTEM Windows 2000 Server.
[guest - Fri Feb 20 12:27:50 2004]: Show quoted text
> This is the error that I get when I run the perl script below. I am > tring to write to an excel file. Let me know what I am doing > wrong. > > Version of Modules That Are Installed > DBI 1.37 > DBIx-Dump 0.04 > DBD-mysqlPP 0.03 > SpeadSheet-WriteExcel 0.42 > > ERRORS: > Filename required by Spreadsheet::WritExcel->new() at > D:/Perl/site/lib/DBIx/Dump.pm line 48 > (in cleanup) Cant use an undefind value as a HASH reference at > D:/Perl/site/lib/Spreadsheet/WriteExcel/Workbook.pm line 553. > Can’t call method “addworksheet” on an undefined value at > D:/Perl/site/lib/DBIx/Dump.pm line 51. > > Here is a copy of my perl script. > > #!D:/perl/bin/perl > use DBI; > use Spreadsheet::WriteExcel; > use DBIx::Dump; > ### Perform the connection using the Mysql Driver. > my $dbh = DBI->connect("DBI:mysqlPP:database=db1;host=localhost", > "root","mysql") > or die "Can't make connect to the database: $DBI::errstr\n"; > my $sql=("select * from table1"); > $sth = $dbh->prepare($sql); > $sth->execute(); > $out = DBIx::Dump->new('format' => 'excel', > 'ouput' => 'db.xls', > 'sth' => $sth,); > $out->dump(); > $dbh->disconnect or warn "Disconnect failed: $DBI::errstr\n"; > exit; > > OPERATIONS SYSTEM > > Windows 2000 Server. >
The error lies in that 'ouput' => 'db.xls' needs to be 'output' => 'db.xls'. The documentation with this module is buggy. So if you cut and paste it will not work as advertised.