This is one of those "can it be done" questions. I've got a stored procedure that could take quite a few input parameters so I was wondering if I can establish one input parameter and then set variables based off the comma separated input. Example...
drop procedure if exists sptest;
delimiter $$
create procedure sptest (v1 varchar(254))
begin
if v1=1 then set @vx1:='test1';end if;
if v1=2 then set @vx2:='test2';end if;
if v1=3 then set @vx3:='test3';end if;
if v1=4 then set @vx4:='test4';end if;
select v1;
select @vx1,@vx2,@vx3,@vx4;
end
call sptest('1,2,3,4');
If possible, any examples/guidance would be appreciated.