Hi,
I'm making one MySql script that break one string field in multiple words.
I need something like the explode function in PHP!
I try the mysql substring_index function but I have to expecify the number of occurences of the one substring. And that is not predictable in one 10.000 row table.
Any sugestion?
this is my actual Stored Procedure:
**CREATE PROCEDURE `extract_words` ()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE result_row CHAR(100);
DECLARE cursor_1 CURSOR FOR SELECT description FROM db_movies;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN cursor_1;
REPEAT
FETCH cursor_1 INTO result_row;
IF NOT done THEN
INSERT INTO extrator_words (word) VALUES (result_row);
END IF;
UNTIL done END REPEAT;
CLOSE cursor_1;
END $$**
Thanks,
Pedro
@pcamacho