create procedure ranking(selectID varchar(300))
begin
declare idCount int
declare strTemp varchar(10)
set strTemp = selectID
while strTemp is not NULL or strTemp = '' do
set idCount = idCount + 1
set strTemp = subString(selectID,1,instr(selectID,','))
end while
set selectID = subString(selectID,1,length(selectID)-1)
SELECT * from matrice where id in (selectID);
create temporary table tempRank(id varchar(10),tempScore double(10))
end
这个存储过程有什么问题吗??语法上?? 请高手指点,整了一天了,就是找不到原因。运行会出这个错:
#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 'int
declare strTemp varchar(10)
set strTemp = selectID
while strTemp is' at line 3
如果只写个空的可以创建成功:
create procedure ranking(selectID varchar(300))
begin
end里面加一点东西都创建失败
create procedure ranking(selectID varchar(300))
begin
declare idCount int
declare strTemp varchar(10)
end
而且还不能alter procedure,。必须删了重来。
begin
declare idCount int
declare strTemp varchar(10)
set strTemp = selectID
while strTemp is not NULL or strTemp = '' do
set idCount = idCount + 1
set strTemp = subString(selectID,1,instr(selectID,','))
end while
set selectID = subString(selectID,1,length(selectID)-1)
SELECT * from matrice where id in (selectID);
create temporary table tempRank(id varchar(10),tempScore double(10))
end
这个存储过程有什么问题吗??语法上?? 请高手指点,整了一天了,就是找不到原因。运行会出这个错:
#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 'int
declare strTemp varchar(10)
set strTemp = selectID
while strTemp is' at line 3
如果只写个空的可以创建成功:
create procedure ranking(selectID varchar(300))
begin
end里面加一点东西都创建失败
create procedure ranking(selectID varchar(300))
begin
declare idCount int
declare strTemp varchar(10)
end
而且还不能alter procedure,。必须删了重来。
declare idCount int;
declare strTemp varchar(10);
set strTemp = selectID;
while strTemp is not NULL or strTemp = '' do
set idCount = idCount + 1;
set strTemp = subString(selectID,1,instr(selectID,','));
end while;
set selectID = subString(selectID,1,length(selectID)-1);
SELECT * from matrice where id in (selectID);
create temporary table tempRank(id varchar(10),tempScore double);
end
需要设置权限吗??怎么设置??
DROP PROCEDURE IF EXISTS `db`.`ranking`