I have the following procedure:
DELIMITER $$
CREATE PROCEDURE retornaArvoresFeedback()
BEGIN
SELECT id, flagFeedback, prazoFeedback
FROM arvore_classificacao
WHERE flagFeedback <> 'null' AND prazoFeedback <> 'null' AND status = 'ATIVO';
END $$
DELIMITER ;
And in a 2nd procedure, I want to use the results of the 1st procedure to mount a new select and from it go through a WHILE.
For example:
2nd procedure:
DELIMITER $$
CREATE PROCEDURE verificaPrazoFeedback()
BEGIN
SELECT * tabela2 WHERE fk.id = <valor da tabela2>
WHILE (condicao)
--- PERCORRE RESULTADO DO 2º SELECT E FAZ ALTERAÇÕES
END WHILE;
END $$
DELIMITER ;