my $sth = $dbh->prepare($sql);
$sth->execute();
- 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
my @types = eval {
map { $dbh->type_info($_) ? $dbh->type_info($_)->{TYPE_NAME} : '?' } @{ $sth->{TYPE} };
warn "## heuristic date time: $1T$2\n" if $debug;
$worksheet->write_date_time( $row, $col, "$1T$2", $date_format );
} else {
+ $data = "'" . $data if $data =~ m/^=/; # escape data which looks like formula
$worksheet->write($row, $col, _c( $data ) );
}
}