CREATE PROCEDURE `up_truncate_all_table`() BEGIN DECLARE done INT DEFAULT 0; DECLARE tname CHAR(50); DECLARE cur1 CURSOR FOR SELECT table_name from INFORMATION_SCHEMA.TABLES WHERE table_schema = 'db_name'; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000