If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > ordering "show tables"

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-20-05, 07:53
arpoodle arpoodle is offline
Registered User
 
Join Date: Sep 2004
Posts: 64
ordering "show tables"

Is there any way to order the "show tables" command, or equivalent way of returning table info.

I have a shell script that creates a new log table weekly, and copies data into the table created from a live data table.

problem is, I've used the "show tables" command to find out what the existing table numbering is, and to give me a CSV list to alter the merge engine table that looks at these archive tables.

the table list from "show tables" comes out as...

log_1
log_10
log_2
log_3
log_4
log_5
log_6
log_7
log_8
log_9

dumping this into a txt file, and then getting the last record is obviously wrong now, due to how it's ordered.

Is there any way to order the show tables using creation date or something?

regards

Andrew
Reply With Quote
  #2 (permalink)  
Old 09-20-05, 08:53
arpoodle arpoodle is offline
Registered User
 
Join Date: Sep 2004
Posts: 64
problem solved.

renamed all the low number tables to

log_01
log_02 etc

solved the ordering problem
Reply With Quote
  #3 (permalink)  
Old 09-26-05, 07:01
gtk gtk is offline
Registered User
 
Join Date: Oct 2004
Location: Paris, FRANCE
Posts: 132
Which is a slightly better idea
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On