Well from phpMyAdmin I'm doing a crud with case, and well he tells me that there is syntax error nothing else I do not see something bad.
My code is this:
create PROCEDURE usuarioXY
(in _idUser int(11),
in _usuario char(50),
in _consetrasena char(50),
in accion varchar(40)
)
begin
case accion
when 'nuevo' then
insert into usuarios (usuario, contrasena) values (_usuario, _contrasena);
when 'editar' then
update usuarios set
usuario = _usuario, contrasena = _contrasena;
when 'eliminar' then
delete from usuarios where idUser = _idUser;
when 'consulta' then
select * from usuarios where idUser = _idUser;
end case
end
The error that comes to me is this:
1064 - Something is wrong in its syntax near '' on line 10
which is after the case, is in the line of the insert:
when 'nuevo' then
insert into usuarios (usuario, contrasena) values (_usuario, _contrasena);
Can someone tell me what may be happening? I can not see the error.