Problem resolved :)
My mistake - the column in the view was empty:
This script works correctly:
var range = @DbColumn("","alle",1);
function rand(range_from,range_to)
{
var r = Math.random();
r = r * (range_to-range_from) + range_from;
return Math.round(r);
}
var result = range[rand(0,range.length-1)];
return result
Pozdrawiam Tomek