コード例 #1
0
 protected IServerExpressionPlan PrepareRootPlan()
 {
     if (_rootPlan == null)
     {
         _rootParams = new Runtime.DataParams();
         ((DAEDataSet)_link.DataSet).GetAllParams(_rootParams);
         _rootPlan = _process.PrepareExpression(GetExpression(_rootExpression), _rootParams);
     }
     return(_rootPlan);
 }
コード例 #2
0
        /// <summary>Evaluates the given expression using the given process and returns the result.</summary>
        public DAE.Runtime.Data.IDataValue EvaluateRaw(IServerProcess process, string expression, DAE.Runtime.DataParams paramsValue)
        {
            CheckActive();

            if (process == null)
            {
                process = UtilityProcess;
            }

            IServerExpressionPlan plan = process.PrepareExpression(expression, paramsValue);

            try
            {
                return(plan.Evaluate(paramsValue));
            }
            finally
            {
                process.UnprepareExpression(plan);
            }
        }
コード例 #3
0
        /// <summary>Opens a cursor on the given expression using the given process.</summary>
        public IServerCursor OpenCursor(IServerProcess process, string expression, DAE.Runtime.DataParams paramsValue)
        {
            CheckActive();

            if (process == null)
            {
                process = UtilityProcess;
            }

            IServerExpressionPlan plan = process.PrepareExpression(expression, paramsValue);

            try
            {
                return(plan.Open(paramsValue));
            }
            catch
            {
                process.UnprepareExpression(plan);
                throw;
            }
        }
コード例 #4
0
ファイル: Session.cs プロジェクト: laszlo-kiss/Dataphor
        public DAE.Runtime.Data.Scalar EvaluateScalar(IServerProcess process, string expression, DAE.Runtime.DataParams paramsValue)
        {
            if (process == null)
            {
                process = DataSession.UtilityProcess;
            }

            DAE.IServerExpressionPlan plan = process.PrepareExpression(expression, paramsValue);
            try
            {
                ErrorList errors = new ErrorList();
                errors.AddRange(plan.Messages);
                ReportErrors(null, errors);

                return((DAE.Runtime.Data.Scalar)plan.Evaluate(paramsValue));
            }
            finally
            {
                process.UnprepareExpression(plan);
            }
        }
コード例 #5
0
ファイル: DAEDataSet.cs プロジェクト: mkbiltek2019/Dataphor
            private void InternalPrepare()
            {
                if (_plan == null)
                {
                    _plan = _process.PrepareExpression(_expression, _params);
                    try
                    {
                        ErrorsOccurred(_plan.Messages);

                        if (!(_plan.DataType is Schema.ITableType))
                        {
                            throw new ClientException(ClientException.Codes.InvalidResultType, _plan.DataType == null ? "<invalid expression>" : _plan.DataType.Name);
                        }

                        _tableVar = _plan.TableVar;
                    }
                    catch
                    {
                        _plan = null;
                        throw;
                    }
                }
            }