Those types of queries will be available soon as the INFORMATION_SCHEMA views are in development. Keep your eyes on the next few releases of MySQL for this feature to appear (it may already be active in the 5.0.2 release just announced but I haven't had time to check yet). Until then you will need to parse the results of SHOW CREATE TABLE just as everyone has already suggested.
Shawn Green Database Administrator Unimin Corporation - Spruce Pine Roger Baklund <[EMAIL PROTECTED]> wrote on 12/02/2004 07:01:23 AM: > [EMAIL PROTECTED] wrote: > > Hi, > > Thank you. But I want select the constraints and indices used on the > > table. How can we get this information?. Please help me in this. > > Ian gave you the answer: > > > From: Ian Sales > [...] > > - show indexes from DATABASE_NAME.TABLE_NAME > > The syntax is: SHOW INDEX FROM tablename FROM dbname > > > - or, show create table DATABASE_NAME.TABLE_NAME; > > To elaborate: You can not use the SELECT statement to get this > information in MySQL, like you can in Oracle. In MySQL, you can only get > this information from other statements, like SHOW INDEX FROM ... and > SHOW CREATE TABLE. > > <URL: http://dev.mysql.com/doc/mysql/en/SHOW_INDEX.html > > <URL: http://dev.mysql.com/doc/mysql/en/SHOW_CREATE_TABLE.html > > > -- > Roger > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] >