I want to do the following insert in MySql
CREATE PROCEDURE cadastroLocal (var_localNome varchar(80), var_horainicial TIME, var_horafinal TIME, var_periodoemminutos INTEGER, var_diasdasemana INTEGER)
BEGIN
INSERT INTO LOCAL (LOCAL.NOME) VALUES (var_localNome);
SET @localid = LAST_INSERT_ID();
INSERT INTO HORARIO (HORARIO.HORAINICIAL, HORARIO.HORAFINAL, HORARIO.PERIODOEMMINUTOS) VALUES (var_horainicial, var_horafinal, var_periodoemminutos);
SET @horarioid = LAST_INSERT_ID();
INSERT INTO CONFIGURACAODELOCAL (CONFIGURACAODELOCAL.LOCALID, CONFIGURACAODELOCAL.DIADASEMANA, HORARIO.HORARIOID) VALUES (@localid, var_diasdasemana, @horarioid);
However, the following error appears:
You have an error in your SQL syntax; check the manual that correspond to your MySQL server version for the right syntax to use near '' at line 3
Being that nowhere exists these simple quotes. I have already looked at documentation and other questions that are for two tables.
Does anyone give an idea, or does anyone know if this is possible for more than two tables?