calculate factorial with stored procedure – Query Examples