Re: Creating my own Data dictionary
>I want to create a "data dictionary" table of all my user tables in a
>certain database. The data dictionary (my version) will contain
>columns such as "TableName", "ColumnName", "DataType", "DataLength",
>etc, etc. I know this information is available in the MySQL engine
>tables, I just don't know where to look for it. I'm using 5.0.
You might be able to do this by creating a view on information_schema.
>Any hints? For example, how do I obtain a list of all the ColumnNames
>and data types in a table I created named "Vehicles"?
select COLUMN_NAME from information_schema.COLUMNS
where TABLE_SCHEMA='database name' and TABLE_NAME='Vehicles';
You can also use "describe Vehicles;" in current and older versions of
MySQL, but the format isn't the same.
Gordon L. Burditt
|