|
|||||||||||
|
dynamic sql in proc
From: Bryan Cantwell <bcantwell(at)firescope.net>
Date: Thu Jun 28 2007 - 18:33:39 EDT
I just want a programatic way to upgrade db engine to innodb where I don't know exactly what tables exist... DELIMITER $$
DROP PROCEDURE IF EXISTS `firescope`.`MYISAMtoINNODB` $$
CREATE PROCEDURE `MYISAMtoINNODB`()
OPEN cur1;
IF NOT done THEN
SET @stmt_text=CONCAT("ALTER TABLE ", @table_name, " ENGINE =
InnoDB");
PREPARE stmt FROM @stmt_text;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END IF; UNTIL done END REPEAT; CLOSE cur1; END $$ DELIMITER ; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=lists@pantek.comReceived on Thu Jun 28 18:34:54 2007 This archive was generated by hypermail 2.1.8 : Thu Jun 28 2007 - 18:40:03 EDT |
||||||||||
|
|||||||||||