有人可以为我修复这个SQL代码吗? [重复]

This question already has an answer here:

In this code i got #1064 error at line 5. can somebody rewrite the code; Thank you

  CREATE FUNCTION thuva.CreateGroup(GroupName VARCHAR(50), GroupIcon TEXT, GroupDescription VARCHAR(130), GroupCreator INT)
  RETURNS int(11)
  DETERMINISTIC
BEGIN
  DECLARE groupID INT;
  INSERT INTO groups (name, icon, description) VALUES (GroupName, GroupIcon, GroupDescription);
  SET groupID = LAST_INSERT_ID();
  INSERT INTO group_members VALUES (groupID, GroupCreator);
  RETURN groupID;
END;

</div>

Try using this syntax

DECLARE variable_name datatype [ DEFAULT initial_value ]

since its a datatype you need to define size something like.

DECLARE groupID INT(11);