读书人

一个很简单的存储过程大家帮小弟我看

发布时间: 2012-02-02 23:57:14 作者: rapoo

一个很简单的存储过程,大家帮我看看错在哪里了
create PROCEDURE lczUpdateMyFriends(
$MyId MEDIUMINT,
$MyFriendId MEDIUMINT,
$GroupName VARCHAR(200),
$OType VARCHAR(200)/*add--add friend, DEL-delete friend,move-move to another group*/
)
BEGIN
IF ($OType= 'add ') then
BEGIN
insert t_friendlist VALUES($MyId,$MyFriendId,$GroupName);
END;
ELSE
BEGIN
IF ($OType= 'del ') then
BEGIN
delete from t_friendlist where f_id=$MyId and iadd=$MyFriendId;
END;
ELSE
BEGIN
IF ($OType= 'mov ') then
update t_friendlist set groupName=$groupName where f_id=$MyId and iadd=$MyFriendId;
End if;
END;
END IF;
END;
END /////26行

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 ' ' at line 26


[解决办法]
26行加上分隔符
比如END$$ /////26行

读书人网 >Mysql

热点推荐