public SelectDataFromFunctionText(SqlBuiltinScalarFunctionCallExpression functionCall,
                                   RawData rawData, SelectDataFunctionInfo info)
 {
     _FunctionCall = functionCall;
     _RawData      = rawData;
     if (info.ReturnDbType.HasValue)
     {
         _ReturnType = info.ReturnType;
         _DbType     = info.ReturnDbType.Value;
     }
 }
Пример #2
0
        public SelectDataFromFunctionLeadLag(SqlBuiltinScalarFunctionCallExpression functionCall, RawData rawData, SelectDataFunctionInfo info)
        {
            _FunctionCall = functionCall;
            _RawData      = rawData;
            if (info.ReturnDbType.HasValue)
            {
                _ReturnType = info.ReturnType;
                _DbType     = info.ReturnDbType.Value;
            }

            _SelectExpression = ParseAsSelect(_FunctionCall.Tokens);
            var batch = ExecuteSelect(_SelectExpression, _RawData.RawRowList.FirstOrDefault());

            _DbType     = ( DbType )Enum.Parse(typeof(DbType), batch.Fields[0].DbType, true);
            _ReturnType = batch.Fields[0].NetType;
        }
 public SelectDataFromFunctionConversion(SqlBuiltinScalarFunctionCallExpression functionCall, RawData rawData, SelectDataFunctionInfo info)
 {
     _FunctionCall = functionCall;
     _RawData      = rawData;
     if (info.ReturnDbType.HasValue)
     {
         _ReturnType = info.ReturnType;
         _DbType     = info.ReturnDbType.Value;
     }
     else if (functionCall is SqlCastExpression castFunction)
     {
         var dataTypeInfo = new DataTypeInfo(castFunction.DataType.Sql, rawData.Database.UserDataTypes);
         _ReturnType = dataTypeInfo.NetDataType;
         _DbType     = dataTypeInfo.DbDataType;
     }
 }
 public SelectDataFromFunctionRandom(SqlBuiltinScalarFunctionCallExpression functionCall,
                                     RawData rawData, SelectDataFunctionInfo info)
 {
     _FunctionCall = functionCall;
     _RawData      = rawData;
 }
 public SelectDataFromFunctionMathAggregate(SqlBuiltinScalarFunctionCallExpression functionCall, RawData rawData, SelectDataFunctionInfo info)
 {
     _FunctionCall = functionCall;
     _RawData      = rawData;
     if (_NeedsColumn.Contains(_FunctionCall.FunctionName.ToUpper()))
     {
         _ColumnRef = GetSingleColumn(  );
         var tc = Helper.GetTableColumn(_ColumnRef, _RawData);
         _ReturnType = tc.Column.NetDataType;
         _DbType     = tc.Column.DbDataType;
     }
 }