mysql 创建存储过程报错!
mysql>createprocedureaa()->BEGIN->declarev_countnumber;->FORcurIN(SELECT*FROMBillinfo...
mysql> create procedure aa()
-> BEGIN
-> declare v_count number;
-> FOR cur IN (SELECT * FROM Billinfo) LOOP INSERT INTO Billinfo_test VALUES cur;
-> v_count := v_count + 1;
-> IF v_count >= 1000 THEN
-> COMMIT;
-> END IF;
-> END LOOP;
-> COMMIT;
-> END
-> //
ERROR 1064 (42000): 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 'number;
FOR cur IN (SELECT * FROM Billinfo) LOOP INSERT INTO Billinfo_test V' at line 3
求高手指教如何修改上面的创建存储过程语句。 展开
-> BEGIN
-> declare v_count number;
-> FOR cur IN (SELECT * FROM Billinfo) LOOP INSERT INTO Billinfo_test VALUES cur;
-> v_count := v_count + 1;
-> IF v_count >= 1000 THEN
-> COMMIT;
-> END IF;
-> END LOOP;
-> COMMIT;
-> END
-> //
ERROR 1064 (42000): 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 'number;
FOR cur IN (SELECT * FROM Billinfo) LOOP INSERT INTO Billinfo_test V' at line 3
求高手指教如何修改上面的创建存储过程语句。 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询