On Tue, 2002-11-26 at 08:49, 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.

You can still use it in a prepare() call. I've used "show columns from
<tablename>" with DBI/DBD::MySQL with no problem.

Michael


> 
> 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
> > 
> 
> 
-- 
Michael Peppler / [EMAIL PROTECTED] / http://www.mbay.net/~mpeppler
[EMAIL PROTECTED] / ZetaTools, Inc / http://www.zetatools.com
ZetaTools: Call perl functions as Sybase stored procedures!

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to