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} }; |
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 |
} |
} |