protected IServerExpressionPlan PrepareRootPlan() { if (_rootPlan == null) { _rootParams = new Runtime.DataParams(); ((DAEDataSet)_link.DataSet).GetAllParams(_rootParams); _rootPlan = _process.PrepareExpression(GetExpression(_rootExpression), _rootParams); } return(_rootPlan); }
/// <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); } }
/// <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; } }
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); } }
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; } } }