MySQL Forums
Forum List  »  Newbie

Re: How to query MySQL to get a table definition (column defs, constraint defs (pk, fk, uni...))
Posted by: Ramalingam Chelliah
Date: August 19, 2004 05:48AM

Hi ,
Aren't you satisfied with 'DESCRIBE' ?

mysql > DESC myTable;

It lists your table's structure in a table from...

Otherwise you can use 'SHOW CREATE TABLE <tablename>' to look
into the CREATE statement used to CREATE the table and the table type

mysql> SHOW CREATE TABLE myTable;


Try these too
mysql> SHOW FULL COLUMNS FROM myTable;

and 'SHOW INDEX'

Check this page

http://dev.mysql.com/doc/mysql/en/SHOW.html


Hope this helps...

Regards,
Ram.





We Learn the Most When we have to Invent

Options: ReplyQuote


Subject
Written By
Posted
Re: How to query MySQL to get a table definition (column defs, constraint defs (pk, fk, uni...))
August 19, 2004 05:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.