I'm an admitted newbie with stored procedures. The following is generating a syntax error.
"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 3"
CREATE PROCEDURE get_user_association_list (IN uid INT)
BEGIN
DECLARE rolelist VARCHAR(255);
DECLARE role_id INT;
DECLARE cur1 CURSOR FOR SELECT assoc_type_id FROM cause_users_assoc WHERE user_id = uid;
OPEN cur1;
REPEAT
FETCH cur1 INTO role_id;
SET rolelist = CONCAT(rolelist, role_id);
SET rolelist = CONCAT(rolelist, ',');
UNTIL done END REPEAT;
CLOSE cur1;
RETURN rolelist;
END;
Help please.