Re: Make new tables on top of old ones

2001-09-07 Thread Ed Carp

Deryck Henson ([EMAIL PROTECTED]) writes:

> I need to make about 15 tables that use the same template as the first one.
> Please help.


Please post more information. Platform, software, etc. This is like saying, "I want to 
get from point A to point B. Please help."


OK, I've got that out of my system. Now, if you're on a UNIX/Linux/*BSD box, you can 
do:

# assume name1...nameN is the names of your clone tables
# assume origtable is the name of your original table
# from the shell prompt:

$ for i in name1 name2 name3 name4 ... name15
do
mysqldump -d databasename origtable|sed -e "s/CREATE TABLE origtable/CREATE TABLE 
$i/g"|mysql databasename
done

Tada!
--
Ed Carp, N7EKG  -  [EMAIL PROTECTED]  -  214/341-4420 - http://www.pobox.com/~erc

Squished Mosquito, Inc.
Internet Applications Development
Escapade Server-Side Scripting Language Development Team
http://www.squishedmosquito.com
Pensacola - Dallas - Dresden - London

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Make new tables on top of old ones

2001-09-07 Thread Deryck Henson

I need to make about 15 tables that use the same template as the first one.
Please help.

- Deryck H
- http://www.comp-u-exchange.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php