Thanks to all.  I never imagined that I could simply issue standard sql
statements.  I prepared and executed "DESCRIBE tablename" with a
fetchrow_hashref.  It returned a nice hash reference containing all the
information I see when I execute the same statement in mysql.  Again thanks
to all.

Chris 

-----Original Message-----
From: Michael Ragsdale [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 26, 2002 1:49 PM
To: Jeff Seger
Cc: darren chamberlain; [EMAIL PROTECTED]
Subject: Re: Table Names


Sorry if I was unclear.  I was answering the original question of obtaining 
a list of all the table names.

-Mike

At 12:48 PM 11/26/2002, Jeff Seger wrote:
>OK, but that's not using the SHOW TABLES command.  Maybe I was unclear
>about that.
>
>On Tue, 2002-11-26 at 12:10, Michael Ragsdale wrote:
> > Yes you can.  From the fine cheetah book, under metadata...
> >
> >
> > my @tables = $dbh->tables();
> > foreach my $table ( @tables ) {
> >      print "Table: $table\n";
> > }
> >
> >
> >
> > -Mike
> >
> >
> > At 11:49 AM 11/26/2002, Jeff Seger wrote:
> > >I may be wrong...I seem to be making a habit of it lately...but I don't
> > >think you can.  SHOW TABLES is a mysql command, not an sql statement.
> > >
> > >On Tue, 2002-11-26 at 10:02, 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
> > > >
> >
> >

Reply via email to