Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Generating ALTER TABLE code for MySQL

by liz (Monsignor)
on Oct 21, 2006 at 09:28 UTC ( #579747=note: print w/replies, xml ) Need Help??


in reply to Generating ALTER TABLE code for MySQL

Version 5.0 of MySQL has:
CREATE TABLE new_tbl LIKE orig_tbl;
Use LIKE to create an empty table based on the definition of another table, including any column attributes and indexes defined in the original table (see http://dev.mysql.com/doc/refman/5.0/en/create-table.html ).

Maybe something like that, in combination with a SELECT from the table into the new table, and some table renames, would also be an option?

Liz

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://579747]
help
Chatterbox?
[Lady_Aleena]: Renaming things like get_THAC0 to just THAC0 was easy. These are harder.
[james28909]: consolidate the three subs into one
[Lady_Aleena]: Um, what?
[james28909]: check is is data or hash or array and do tasks then return needed data
[Lady_Aleena]: james28909, you might want to look at the other two on my scratchpad.
[james28909]: after you send to a sub, you can check if it is array or ref ect with ref

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-05-24 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?