0
I am trying to create the second precedure in mysql, but when I enter the first line of the declare the following error:
ERROR 1064 (42000)
CREATE PROCEDURE finaliza_expedicao (IN expedicao_id INT)
BEGIN
DECLARE id_prod INT;
DECLARE id_conf INT;
DECLARE id_int INT;
SELECT id INTO id_prod FROM expedicao WHERE codigo = expedicao_id;
SELECT conferencia_id INTO id_conf FROM separacao WHERE expedicao_id = id_prod;
SELECT interno_id INTO id_int WHERE conferencia_id = id_conf
UPDATE volume SET contido_em_id = NULL, area_id = NULL, expedicao_id = id_prod
WHERE id = id_int;
UPDATE expedicao SET data_fim = DATE_FORMAT(NOW(), '%Y-%m-%d H:i:s') WHERE id =
id_prod;
END
The following error appeared when I went to test ERROR 1064 (42000): 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 ';
– Marcius Leandro
You replaced the tag
[sua_tabela]
? Pq in question you did not put there did not know the name– arllondias
I had one ; the most.
– Marcius Leandro