How to get a list of table names for a database via ODBC in Windows using
Steve Holden
sholden at holdenweb.com
Thu Oct 10 08:53:31 EDT 2002
"Mark Charsley" <mark.charsley at REMOVE_THIS.radioscape.com> wrote in message
news:memo.20021010135455.1016A at a.radioscape.com...
> In article <q7eqna.gr3.ln at ix.netcom.com>, wlfraed at ix.netcom.com (Dennis
> Lee Bieber) wrote:
>
> > Of course, MySQL decides to be strange... "show tables"; there
> > doesn't seem to be a master index of tables in a database other than
> > what MySQL finds in scanning the database directory.
>
> Tut, tut: Dr. Codd would be upset.
>
> > Haven't found what you'd use with M$ SQL Server...
>
> "select * from INFORMATION_SCHEMA.TABLES" ought to do it.
>
> I _think_ ODBC has a DB-independent way of getting schema
> meta-information,
It has: the Tables() function ...
> but whether mxODBC gives you access to it is another
> matter.
>
... which IIRC is exposed as a cursor method. See "Catalog Methods" in the
mxODBC docs.
regards
-----------------------------------------------------------------------
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/pwp/
Previous .sig file retired to www.homeforoldsigs.com
-----------------------------------------------------------------------
More information about the Python-list
mailing list