create procedure `eval`( in param text )
begin
set @sql = param;
prepare stmt from @sql;
execute stmt;
deallocate prepare stmt;
end
Anropa proceduren call tests.eval('set @ABC = 120')
och i den aktuella sessionen kan du komma åt variabeln @ABC
call tests.eval('set @ABC = 120');
select @ABC;