Solved

Show Table Status Where Rows 100 Then Insert?

Posted on 2008-06-19
3
497 Views
Last Modified: 2008-06-19

Q. Anyway to Insert the results of Show Table Status into another table?

ie... Insert Into table2 (col_Name, col_Rows) Values (show table status where rows > 100)
0
Comment
Question by:kvnsdr
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 500 total points
ID: 21824114
Unfortunately, you can not capture output from a SHOW command. If you want manipulate the data, you will have to select it from INFORMATION_SCHEMA

e.g.

SELECT * FROM information_schema.`TABLES` where table_schema = 'test'
0
 
LVL 24

Assisted Solution

by:mankowitz
mankowitz earned 500 total points
ID: 21824124
After that, you can use the insert...select syntax

INSERT t2 (col, col, col) SELECT col,col,col FROM information_schema
0
 
LVL 1

Author Comment

by:kvnsdr
ID: 21828242
Finished, working code:

Insert Into MyDatabase.table1 (`col_Name`, `col_Rows`) SELECT `Table_Name`, `Table_Rows` FROM information_schema.`TABLES` where table_schema = 'test'

Perfect,

Thank You...
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now