求助:mysql语法错误
create procedure test()
begin
DECLARE o datetime
DECLARE n int
DECLARE i int
DECLARE cur_1 CURSOR FOR SELECT dateTime FROM sword_00242_1440
DECLARE CONTINUE HANDLER FOR NOT FOUND SET @n=1
set @i=0
SET @n=0
OPEN cur_1
while @n=0 do
@i=@i+1
fetch cur_1 into o
update sword_00242_1440 set dateTime=adddate(dateTime,@i) where dateTime=@o
end while
close cur_1
end
call test()
错误信息:Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'datetime
DECLARE n int
DECLARE i int
DECLARE cur_1 CURSOR FOR SELECT dateTime ' at line 3
(0 ms taken)
没用过mysql的存储过程,语法也不懂,最近要准备测试数据,将数据库中的datetime字段每行递增加一天,请问哪里出错了?