In addition to Shawn's suggestions, the other approach you could take would
be to write Java programs that make use of the DataBaseMetaData and
ResultSetMetaData interfaces. I've used this approach with success, although
not to any great extent yet.

Of course, if you don't know Java or don't approve of having to write
applications to get this sort of information, Shawn's approaches are going
to be better for you ;-)

Rhino

----- Original Message ----- 
From: "Dave Merrill" <[EMAIL PROTECTED]>
To: "MySql" <mysql@lists.mysql.com>
Sent: Wednesday, January 12, 2005 4:07 PM
Subject: Getting info about db columns


> Hi, mysql newb here, coming mostly from ms sql server.
>
> I'm wondering how to find out basic info (type, str length, column name if
> getting all cols from a list of tables, etc), about a set of columns from
a
> number of different tables. I'm also interested in getting a list of the
> tables in a db.
>
> SQL Server has a pair of views (information_schema.tables and
> information_schema.columns) that were useful for this kind of thing. Since
> they're normal views, you can restrict the tables or cols found by table,
> column, type, etc, and retrieve only the info you want about them;
anything
> that works in a std query works here.
>
> The only way I know of to get this kind of metadata from mysql is explain,
> which appears to only return a fixed set of info about all the columns in
a
> single table. Is there any way to get:
>
> - A list of tables in a db
> - Column info for more than one table at once
> - Only certain info about these cols (name and type only, say)
>
> Thanks,
>
> Dave Merrill
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to