2
I’m creating a precedent for it to store the food name in the Procedure food variable, follow the code:
DELIMITER $$
CREATE PROCEDURE armazena_nome(id INT, OUT alimento VARCHAR(20))
BEGIN
SELECT alimentos_dados.nome_alimento INTO alimento FROM alimentos_dados WHERE alimentos_dados.id_alimento = id;
END $$
DELIMITER ;
When I code below after making "CALL" in the past it should return the food name but returns null:
SELECT @alimento
What am I doing wrong ?
Put the steps you created and called this procedure?
– novic