Exemple #1
0
        // frowsIndex is not preserved to the caller!
        List <DbValue> _ProcessSelectCallInfo(CallInfo ci)
        {
            int                        frowsTotal   = frows.Count;
            List <DbValue>             results      = functools.AllocDbValueList();
            bool                       IsAggregator = (null != ci.func && DbExec.DbAggregatorExists(ci.func));
            List <DbFunctionArguments> fargs        = _CallArgsToExecArgs(ci);

            if (IsAggregator)
            {
                DbValue value = DbExec.ExecDbAggregator(ci.func, functools, new DbAggregatorArguments(fargs));
                results.Add(value);
            }
            else
            {
                int fargsCount = fargs.Count;
                if (null != ci.func)
                {
                    for (int ifarg = 0; ifarg < fargsCount; ifarg++)
                    {
                        DbValue value = DbExec.ExecDbScalarFunction(ci.func, functools, fargs[ifarg]);
                        results.Add(value);
                    }
                }
                else //if (null == ci.func)
                {
                    for (int ifarg = 0; ifarg < fargsCount; ifarg++)
                    {
#if DEBUG
                        if (1 != fargs[ifarg].Length)
                        {
                            throw new Exception("DEBUG:  (1 != fargs[ifarg].Length)");
                        }
#endif
                        DbValue value = fargs[ifarg][0];
                        results.Add(value);
                    }
                }
            }
            return(results);
        }
Exemple #2
0
 public DbValue ExecDbFunction(string name, DbFunctionArguments args)
 {
     return(DbExec.ExecDbScalarFunction(name, functools, args));
 }