Answers for "proc"

0

proc

drop procedure if exists get_user;
delimiter #
create procedure get_user
(
in p_user_id int unsigned,
in p_explain tinyint unsigned
)
begin
  if (p_explain) then
    explain select * from users where user_id = p_user_id;
  end if;
  select * from users where user_id = p_user_id;
end#

delimiter ;

call get_user(1,1);
Posted by: Guest on April-27-2021

Browse Popular Code Answers by Language