From: Ken Date Date: 2010-01-05T19:14:00+09:00 Subject: [ruby-list:46730] Re: MySQLテーブル数の把握 伊達と申します。 DBI::StatementHandle#rows で結果の行数を得ることができます。 http://ruby-dbi.rubyforge.org/rdoc/classes/DBI/StatementHandle.html#M000230 sth = dbh.execute('show tables') puts sth.rows #=> 9 あるいは、MySQL5であれば information_schema を使って取得することもできます。 sth = dbh.execute("select count(table_name) from information_schema.tables where table_schema = 'fbsys'") puts sth.fetch_all #=> 9