create procedure `eval`( in param text )
begin
set @sql = param;
prepare stmt from @sql;
execute stmt;
deallocate prepare stmt;
end
Roep de procedure aan call tests.eval('set @ABC = 120')
en in de huidige sessie hebt u toegang tot de variabele @ABC
call tests.eval('set @ABC = 120');
select @ABC;