mardi 21 juin 2016

Troubleshoot with MySql Procedure

I'm trying to do a procedure for update one table, but When I try to run the script on PhpMyAdmin I shown "error", this is the procedure

delimiter $
CREATE PROCEDURE UpdateMatrimonio(


IN m_id_matrimonio int,
IN m_id_novio int,
IN m_id_novia int,

IN m_fecha date,

IN m_testigo1 varchar(50),
IN m_testigo2 varchar(50),

IN m_padrino varchar(50),
IN m_madrina varchar(50),
IN m_sacerdote varchar(50),

IN m_numero int,
IN m_folio int,
IN m_acta int,
IN m_usuario int
)
 BEGIN


 UPDATE `Matrimonios` SET 
                      id_novio = m_id_novio,
                      id_novia = m_id_novia,

                      fecha = m_fecha,

                      testigo1 = m_testigo1, 
                      testigo2 = m_testigo2, 
                      padrino = m_padrino , 
                      madrina = m_madrina, 
                      sacerdote = m_sacerdote, 

                      numero = m_numero, 
                      folio = m_folio, 
                      acta = m_acta,
                      usuario = m_usuario 
                      where id_matrimonio = m_id_matrimonio;
END; 
delimiter $;

When I delete the Delimiter $ shown this.

MySQL said: Documentation 1064 - 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 '' at line 41

Aucun commentaire:

Enregistrer un commentaire