/[SQL2XLS]/sql2xls.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sql2xls.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 24 by dpavlin, Thu Nov 6 10:53:59 2008 UTC revision 28 by dpavlin, Thu Dec 27 12:57:01 2012 UTC
# Line 200  foreach my $sql_file (@sql_files) { Line 200  foreach my $sql_file (@sql_files) {
200                  my $sth = $dbh->prepare($sql);                  my $sth = $dbh->prepare($sql);
201                  $sth->execute();                  $sth->execute();
202    
203                  next unless $sth->{NAME}; # $sth->rows doesn't work for insert into with MySQL                  next unless $sth->{NAME} && $sth->rows > 0; # $sth->rows alone doesn't work for insert into with MySQL
204    
205                  my @types = eval {                  my @types = eval {
206                          map { $dbh->type_info($_) ? $dbh->type_info($_)->{TYPE_NAME} : '?' } @{ $sth->{TYPE} };                          map { $dbh->type_info($_) ? $dbh->type_info($_)->{TYPE_NAME} : '?' } @{ $sth->{TYPE} };
# Line 224  foreach my $sql_file (@sql_files) { Line 224  foreach my $sql_file (@sql_files) {
224                                          warn "## heuristic date time: $1T$2\n" if $debug;                                          warn "## heuristic date time: $1T$2\n" if $debug;
225                                          $worksheet->write_date_time( $row, $col, "$1T$2", $date_format );                                          $worksheet->write_date_time( $row, $col, "$1T$2", $date_format );
226                                  } else {                                  } else {
227                                            $data = "'" . $data if $data =~ m/^=/; # escape data which looks like formula
228                                          $worksheet->write($row, $col, _c( $data ) );                                          $worksheet->write($row, $col, _c( $data ) );
229                                  }                                  }
230                          }                          }

Legend:
Removed from v.24  
changed lines
  Added in v.28

  ViewVC Help
Powered by ViewVC 1.1.26