sql2xls.cgi
authorMarijana Glavica <mglavica@ffzg.hr>
Fri, 11 Sep 2015 13:48:28 +0000 (15:48 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 28 Oct 2023 09:45:22 +0000 (11:45 +0200)
sql2xls.cgi

index 041e198..ee8c947 100755 (executable)
@@ -200,7 +200,10 @@ foreach my $sql_file (@sql_files) {
                my $sth = $dbh->prepare($sql);
                $sth->execute();
 
-               next unless $sth->{NAME} && $sth->rows > 0; # $sth->rows alone doesn't work for insert into with MySQL
+warn "XX ", $sth->rows;
+               next if $sth->rows == 0;
+warn dump($sth);
+               next unless eval { $sth->{NAME} }; # $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} };