I want to set session_id automatically using the request_time parameter, so I selected the mysql stored procedure containing the case.Here statement goes.
create procedure upd_userinput(in request_time timestamp, out user_session_id int)
begin
update user_input;
case request_time
when time(request_time) < '9:15:00' && time(request_time) > '8:15:00'
then set user_session_id = 1;
when time(request_time)< '10:15:00' && time(request_time) > '11:15:00'
then set user_session_id =2;
end case;
end
//
However, I get error 1064 when entering after //. I checked the mysql documentation, I think the case syntax is correct.
Help me please.
source
share