Ejemplo n.º 1
0
        /// <summary>Executes the prepared statement this plan represents.</summary>
        public void Execute(DataParams paramsValue)
        {
            RemoteParamData localParamsValue = _process.DataParamsToRemoteParamData(paramsValue);

            _plan.Execute(ref localParamsValue, out _programStatistics, _process.GetProcessCallInfo());
            _programStatisticsCached = false;
            _process.RemoteParamDataToDataParams(paramsValue, localParamsValue);
        }
Ejemplo n.º 2
0
 public void Execute(ref RemoteParamData paramsValue, ProcessCallInfo callInfo)
 {
     _script.Process.ProcessCallInfo(callInfo);
     try
     {
         RemoteParam[] localParamsValue = new RemoteParam[paramsValue.Params == null ? 0 : paramsValue.Params.Length];
         for (int index = 0; index < (paramsValue.Params == null ? 0 : paramsValue.Params.Length); index++)
         {
             localParamsValue[index].Name     = paramsValue.Params[index].Name;
             localParamsValue[index].TypeName = paramsValue.Params[index].TypeName;
             localParamsValue[index].Modifier = paramsValue.Params[index].Modifier;
         }
         if (IsExpression())
         {
             PlanDescriptor planDescriptor;
             IRemoteServerExpressionPlan plan = PrepareExpression(localParamsValue, out planDescriptor);
             try
             {
                 ProgramStatistics programStatistics;
                 plan.Close(plan.Open(ref paramsValue, out programStatistics, _script.Process.EmptyCallInfo()), _script.Process.EmptyCallInfo());
                 // TODO: Provide a mechanism for determining whether or not an expression should be evaluated or opened through the remoting CLI.
             }
             finally
             {
                 UnprepareExpression(plan);
             }
         }
         else
         {
             PlanDescriptor             planDescriptor;
             IRemoteServerStatementPlan plan = PrepareStatement(localParamsValue, out planDescriptor);
             try
             {
                 ProgramStatistics programStatistics;
                 plan.Execute(ref paramsValue, out programStatistics, callInfo);
             }
             finally
             {
                 UnprepareStatement(plan);
             }
         }
     }
     catch (Exception E)
     {
         throw WrapException(E);
     }
 }