Solved

Show Table Status Where Rows 100 Then Insert?

Posted on 2008-06-19
3
500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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