-$sth->execute( $last_id );
-warn "# $table columns ",dump( $sth->{NAME} );
-print "import ",$sth->rows," from $table\n";
+ print STDERR " $table:$offset ";
+ $sth->execute( $last_id );
+# warn "# $table columns ",dump( $sth->{NAME} ) if $offset == 0;
+ print STDERR " join ", $sth->rows, " rows ";
+}
+
+our $row;
+sub fetch_row {
+ $row = $sth->fetchrow_hashref();
+ if ( ! $row && $sth->rows == $limit ) {
+ $offset += $limit;
+ select_table;
+ $row = $sth->fetchrow_hashref();
+ }
+ return $row;
+}