create procedure `eval`( in param text )
begin
set @sql = param;
prepare stmt from @sql;
execute stmt;
deallocate prepare stmt;
end
Kald proceduren call tests.eval('set @ABC = 120')
og i den aktuelle session kan du få adgang til variablen @ABC
call tests.eval('set @ABC = 120');
select @ABC;