Or just @tables = $dbh->tables; Tim.
On Tue, Nov 26, 2002 at 10:02:03AM -0500, darren chamberlain wrote: > * Chris Rogers <[EMAIL PROTECTED]> [2002-11-26 09:45]: > > Is there a way to get a list of all table names in specific database > > using DBI::mysql in Perl? > > Can you use SHOW TABLES? E.g.: > > sub show_tables { > my $dbh = shift; > my ($sth, @tables, $table); > > $sth = $dbh->prepare("SHOW TABLES"); > $sth->execute; > > while ($table = $sth->fetchrow) { > push @tables, $table; > } > > $sth->finish; > > return @tables; > } > > (darren) > > -- > I have learnt silence from the talkative, toleration from the > intolerant, and kindness from the unkind; yet strange, I am > ungrateful to these teachers. > -- Kahlil Gibran