Procedure - MySQL error code: # 1064

1
CREATE DEFINER='root'@'localhost'

PROCEDURE 'teste'(IN 'pId' VARCHAR(20))NO SQL

INSERT INTO gpetnaold.pessoal SELECT * FROM gpetna.pessoal WHERE gpetna.pessoal.id=pId;

INSERT INTO gpetnaold.contato SELECT * FROM gpetna.contato WHERE gpetna.contato.pessoal_id=pId;

Someone can help me with this error.

Placing in isolation any of the query works beautifully. when I put the two returns the error;

  

error 1064 'INSERT INTO gpetnaold.contact SELECT * FROM gpetna.contact   WHERE gpetna.contato. ' at line 2 '

    
asked by anonymous 22.09.2016 / 17:08

1 answer

1

I think the structure of your procedure is wrong, so try:

DELIMITER $$
CREATE PROCEDURE nome_da_proc (<seus parametros>)
BEGIN
    /* seu conteudo */
END $$
DELIMITER ;
    
22.09.2016 / 17:29