Results 1 to 3 of 3
Hello, community.
You piece of advice will be very useful!
How to execute "ALTER TABLE" for a lot of tables in database? I'm going to change engine from MyISAM to ...
- 05-07-2009 #1Just Joined!
- Join Date
- Dec 2007
- Posts
- 7
execute `alter table` for a lot of tables
Hello, community.
You piece of advice will be very useful!
How to execute "ALTER TABLE" for a lot of tables in database? I'm going to change engine from MyISAM to NDBCLUSTER. There are several hundreds of tables in database.
Command like
isn't working.Code:ALTER TABLE * ENGINE=NDBCLUSTER
I believe in your help!
Regards,
self_ru
- 05-07-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
In standard SQL there is no way to do this. You need to do it with a stored procedure. For example, in Oracle you could write a PL/SQL procedure to do it, and with Sybase or MS SQL Server you could write a Transact-SQL procedure to do it. I don't know what MySQL provides for a stored procedure language, but I'm sure you can do it there. You can also generate a script that has an alter statement for each table and then execute that.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 05-08-2009 #3Just Joined!
- Join Date
- Dec 2007
- Posts
- 7
Rubberman, thank you very much for answer. I'll know now about it

Regards,
self_ru


Reply With Quote