MYSQL modifies the table name to a large-write stored procedure, mysql Stored Procedure
1. conditions:1.1 Mysql settings are case sensitive2. Execute the following stored procedures:
1 # call uppercase ('database name') 2 drop procedure if exists uppercase; 3 create procedure uppercase (IN dbname VARCHAR (200) 4 BEGIN 5 6 DECLARE done int default 0; 7 8 DECLARE oldname VARCHAR (200); 9 10 DECLARE cur cursor for select table_name FROM information_schema.TABLES WHERE table_schema = dbname; 11 12 declare continue handler for not found set done = 1; 13 14 OPEN cur; 15 16 REPEAT 17 18 FETCH cur INTO oldname; 19 20 SET @ newname = UPPER (oldname); 21 22 SET @ isNotSame = @ newname <> BINARY oldname; 23 24 if not done & @ isNotSame THEN 25 26 SET @ SQL = CONCAT ('rename table'', oldname, ''to'', LOWER (@ newname ), '_ tmp ''); 27 28 PREPARE tmpstmt FROM @ SQL; 29 30 EXECUTE tmpstmt; 31 32 33 SET @ SQL = CONCAT ('rename table '', LOWER (@ newname), '_ tmp' to '', @ newname, '''); 34 35 PREPARE tmpstmt FROM @ SQL; 36 37 EXECUTE tmpstmt; 38 39 deallocate prepare tmpstmt; 40 41 end if; 42 43 UNTIL done end repeat; 44 45 CLOSE cur; 46 47 END
3. Execute the following statement:
Call uppercase ('database name ');