2
I have the procedure
down below
CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_notasAluno`(IN aluno INT)
BEGIN
DECLARE ditCodigo,courseId INT;
DECLARE usuario VARCHAR(50);
DECLARE notafinaloff,notafinalon,somanotaon float;
select gg.id, SUM(finalgrade) AS notaFinal,SUM(grademax) as NotaMaxima from mdl_grade_grades gg
INNER JOIN mdl_grade_items gi on gg.itemid = gi.id
INNER JOIN mdl_course course ON gi.courseid = course.id
INNER JOIN mdl_user user ON gg.userid = user.id
where userid = aluno AND itemmodule like 'assign' GROUP BY itemmodule;
select @ditCodigo=course.idnumber,@usuario=username,@courseId=course.id,SUM(finalgrade) AS notaFinal from mdl_grade_grades gg
INNER JOIN mdl_grade_items gi on gg.itemid = gi.id
INNER JOIN mdl_course course ON gi.courseid = course.id
INNER JOIN mdl_user user ON gg.userid = user.id
where userid = aluno AND itemmodule like 'quiz' GROUP BY itemmodule;
CREATE TEMPORARY TABLE notas (dit_codigo int,login varchar(50),cur_codigo int,notaOn decimal,notaOff decimal,idNota int, notaOffMax decimal) VALUES ()
END
When executing the following error occurs in the creation of the time table:
Syntax error: missing 'semicolon'
Create temporary table
withVALUES ()
?– Marllon Nasser
I will add some parameters that I recover from a select...
– Yuri Rodrigues