Advertisement
Guest User

Untitled

a guest
May 25th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.06 KB | None | 0 0
  1. file: prova.pl
  2.  
  3.  
  4. use DBI;
  5. use DBD::ODBC;
  6. use strict;
  7. use Spreadsheet::WriteExcel::FromDB::Query;
  8.  
  9. my  $dbh = DBI->connect('dbi:ODBC:prova', 'root', 'prova'); { RaiseError => 1, odbc_cursortype => 2};
  10.  
  11. my  $sth = $dbh->prepare("SELECT * FROM tabella1");
  12.  
  13. $sth->execute;
  14.  
  15. my $ss = Spreadsheet::WriteExcel::FromDB->read($dbh, $sth);
  16.  
  17. print $ss->as_xls;
  18.  
  19. my @row;
  20.  
  21. while ( my @row = $sth->fetchrow_array ) {
  22.    print "@row\n";
  23.  
  24.  
  25. }
  26.  
  27.  
  28.  
  29. Errore:
  30.  
  31. C:\Perl\prova>perl prova.pl
  32. Set up gcc environment - 3.4.5 (mingw-vista special r3)
  33. Spreadsheet::WriteExcel::Simple defines neither package nor VERSION--version check failed at C:/Perl/lib/Spreadsheet/WriteExcel/FromDB.pm line 7.
  34. BEGIN failed--compilation aborted at C:/Perl/lib/Spreadsheet/WriteExcel/FromDB.pm line 7.
  35. Compilation failed in require at C:/Perl/lib/Spreadsheet/WriteExcel/FromDB/Query.pm line 8.
  36. BEGIN failed--compilation aborted at C:/Perl/lib/Spreadsheet/WriteExcel/FromDB/Query.pm line 8.
  37. Compilation failed in require at prova.pl line 4.
  38. BEGIN failed--compilation aborted at prova.pl line 4.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement