… my $sth = $dbh->prepare("show tables") or &bail($DBI::errstr); my $rv = $sth->execute or &bail($DBI::errstr); while ( ( my $table_name ) = $sth->fetchrow_array ) { $sth2 = $dbh->prepare("describe $table_name") or die print "Can't do select: $DBI::errstr"; $rv2 = $sth2->execute or die print "Can't execute the query: $DBI::errstr"; while (($field_, $type_, $null_,$key_, $default_, $extra_) = $sth2->fetchrow_array) { #stuff with cols and then rows. } } …