Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: listing tables from within DBD::Sybase
Date: Sep 27 2001 8:28PM
Edward J. Sabol writes:
> Ed Phillips asked:
> > I have a question that I did not see addressed in the docs.
> > I've got a remote database I'm working with. Is there a
> > command callable from DBD::Sybase that will give me a list of
> > the tables in my database; does this command also work on
> > MSSQL databases?
> Dennis Hanson:
> >> You will probably have to do a select from the
> >> sysdatabases table, like so:
> >> select name from sysdatabases order by name
> >> I don't think DBD-Sybase has a specific command or routine
> >> that returns table names.
> Of course it does. Please refer to the table_info method of the DBI
> documentation ("perldoc DBI").
> my $dbh = DBI->connect(...);
> my $sth = $dbh->table_info;
> my $array_ref = $sth->fetchall_arrayref;
Indeed - but as I mentioned elsewhere this uses the sp_tables
"catalog" stored procedure. If MSSQL doesn't include the same proc, or
if it is substantially different in functionality then this might not
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
email@example.com - firstname.lastname@example.org
International Sybase User Group - http://www.isug.com