Procedure - Error code Mysql : #1064

Asked

Viewed 86 times

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;

Can someone help me with this mistake.

If you put any of the query alone, it works great. when I put the two returns the error;

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

1 answer

1


I believe the structure of your trial is wrong, try it this way:

DELIMITER $$
CREATE PROCEDURE nome_da_proc (<seus parametros>)
BEGIN
    /* seu conteudo */
END $$
DELIMITER ;
  • Thank you! Works beautifully...

  • If my solution meets your need, please mark it as an acceptable solution (green check) it improves my reputation ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.