I have corrected the code with the help of answer given in stack overflow. I want to loop through the comma separated string of Ids but not able to do so. Below given proced
I didn't find any suitable method, so I ended up making my own. It's pretty simple.
PROCEDURE db.loop_through_array()
BEGIN
DECLARE strIDs varchar(150) DEFAULT 'one,two,three';
DECLARE element varchar(150);
WHILE strIDs != '' DO
SET element = SUBSTRING_INDEX(strIDs, ',', 1);
UPDATE TestTable SET status = 'C' WHERE Id = element;
IF LOCATE(',', strIDs) > 0 THEN
SET strIDs = SUBSTRING(strIDs, LOCATE(',', strIDs) + 1);
ELSE
SET strIDs = '';
END IF;
END WHILE;
END