?
Solved

Show Table Status Where Rows 100 Then Insert?

Posted on 2008-06-19
3
Medium Priority
?
504 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 2000 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 2000 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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

719 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