Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: listing tables from within DBD::Sybase
Date: Sep 27 2001 8:23PM
ed phillips writes:
> Hi Michael,
> First of all, thanks for a great tool. I've been using the jdbc driver,
> but I'm happy and relieved to have a DBD driver available for Sybase.
> 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?
Well - that depends on whether the MSSQL server has the "sp_tables"
If it does, then you can use $dbh->table_info(...) - see the DBI docs
If it doesn't, then do a select name from sysobjects where type = 'U'
to get a list of tables in a database.
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