CREATE PROCEDURE concatenation()
BEGIN
DECLARE i INT default 1;
declare t varchar(50);
repeat
set @t = concat("INSERT ignore INTO `site_values_" , i , "` (report_time) SELECT CONCAT(", "pcu_rtc_year" , "-" , "pcu_rtc_month" , "-" , "pcu_rtc_day" , " " , "pcu_rtc_hour" , ":" , " pcu_rtc_minute" , ":" , " pcu_rtc_secound",")" ,
" FROM site_values where site_id =" , i);
PREPARE stmt FROM @t;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
set i = i+1;
until i =1001
end repeat;
END;
我有上面的代码。我可以创建程序。但是当我称它为调用连接时,它显示
"SQLSyntaxError (1064, "您的 SQL 语法有错误;请查看与您的 MySQL 服务器版本相对应的手册,以了解在第 1 行的 ': pcu_rtc_minute: pcu_rtc_secound) FROM site_values where site_id =1' 附近使用的正确语法") "
我的代码有什么问题?