public override SqlExpression VisitConstant(SqlConstantExpression constant)
            {
                var value = constant.Value;
                // TODO: if this is an array ...

                return base.VisitConstant(constant);
            }
            public override SqlExpression VisitConstant(SqlConstantExpression constant)
            {
                if (constant.Value.Type is QueryType)
                    hasSubQuery = true;

                return base.VisitConstant(constant);
            }
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            var value = constant.Value;
            if (!value.IsNull && value.Value is SqlQueryObject &&
                ((SqlQueryObject)value.Value).QueryPlan != null) {
                var queryObject = (SqlQueryObject)value.Value;
                var planNode = queryObject.QueryPlan;
                References = planNode.DiscoverQueryReferences(Level, References);
            }

            return base.VisitConstant(constant);
        }
Example #4
0
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            var value = constant.Value;
            if (!value.IsNull && value.Value is SqlQueryObject &&
                ((SqlQueryObject)value.Value).QueryPlan != null) {

                var queryObject = (SqlQueryObject) value.Value;
                var planNode = queryObject.QueryPlan;
                planNode.DiscoverAccessedResources(tableNames);
            }

            return base.VisitConstant(constant);
        }
Example #5
0
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            var value = constant.Value;

            if (value.Type is QueryType)
            {
                // TODO: convert to sql string also a QUERY PLAN
                builder.Append("({QUERY})");
            }
            else if (value.Type is ArrayType)
            {
                var array = (SqlArray)value.Value;
                if (array.IsNull)
                {
                    builder.Append("NULL");
                }
                else
                {
                    builder.Append("(");
                    var sz = array.Length;
                    for (int i = 0; i < sz; i++)
                    {
                        Visit(array[i]);

                        if (i < sz - 1)
                        {
                            builder.Append(", ");
                        }
                    }
                    builder.Append(")");
                }
            }
            else if (value.Type is NullType)
            {
                builder.Append("NULL");
            }
            else if (value.Type.IsPrimitive)
            {
                if (value.IsNull)
                {
                    builder.Append("NULL");
                }
                else
                {
                    builder.Append(value.Value);
                }
            }

            return(constant);
        }
Example #6
0
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            var field = constant.Value;
            if (!Field.IsNullField(field)) {
                var value = field.Value;
                if (value is SqlArray) {
                    var array = (SqlArray) value;
                    for (int i = 0; i < array.Length; i++) {
                        Visit(array.GetValue(i));
                    }
                }
            }

            return base.VisitConstant(constant);
        }
Example #7
0
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            var value = constant.Value;
            if (value.Type.SqlType == SqlTypeCode.Array) {
                var array = value.Value as SqlArray;
                if (array != null && !array.IsNull) {
                    foreach (var exp in array) {
                        if (!exp.IsConstant()) {
                            IsConstant = false;
                            break;
                        }
                    }
                }
            }

            return base.VisitConstant(constant);
        }
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            var field = constant.Value;

            if (!Field.IsNullField(field))
            {
                var value = field.Value;
                if (value is SqlArray)
                {
                    var array = (SqlArray)value;
                    for (int i = 0; i < array.Length; i++)
                    {
                        Visit(array.GetValue(i));
                    }
                }
            }

            return(base.VisitConstant(constant));
        }
Example #9
0
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            var value = constant.Value;

            if (value.Type.TypeCode == SqlTypeCode.Array)
            {
                var array = value.Value as SqlArray;
                if (array != null && !array.IsNull)
                {
                    foreach (var exp in array)
                    {
                        if (!exp.IsConstant())
                        {
                            IsConstant = false;
                            break;
                        }
                    }
                }
            }

            return(base.VisitConstant(constant));
        }
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            var value = constant.Value;
            if (value.Type is QueryType) {
                // TODO: convert to sql string also a QUERY PLAN
                builder.Append("({QUERY})");
            } else if (value.Type is ArrayType) {
                var array = (SqlArray) value.Value;
                if (array.IsNull) {
                    builder.Append("NULL");
                } else {
                    builder.Append("(");
                    var sz = array.Length;
                    for (int i = 0; i < sz; i++) {
                        Visit(array[i]);

                        if (i < sz - 1)
                            builder.Append(", ");
                    }
                    builder.Append(")");
                }
            } else if (value.Type is NullType) {
                builder.Append("NULL");
            } else if (value.Type.IsPrimitive) {
                if (value.IsNull) {
                    builder.Append("NULL");
                } else {
                    builder.Append(value.Value);
                }
            }

            return constant;
        }
            public override SqlExpression VisitConstant(SqlConstantExpression constant)
            {
                var value = constant.Value;
                if (value.Type is ArrayType) {
                    var array = (SqlArray) value.Value;
                    foreach (var element in array) {
                        columnNames.AddRange(element.DiscoverReferences());
                    }
                }

                return base.VisitConstant(constant);
            }
Example #12
0
 public override SqlExpression VisitConstant(SqlConstantExpression constant)
 {
     // TODO: if the value is an array iterate
     return base.VisitConstant(constant);
 }
Example #13
0
 public override SqlExpression VisitConstant(SqlConstantExpression constant)
 {
     // TODO: if the value is an array iterate
     return(base.VisitConstant(constant));
 }
Example #14
0
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            dataType = constant.Value.Type;

            return base.VisitConstant(constant);
        }
Example #15
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="constant"></param>
 /// <returns></returns>
 public virtual SqlExpression VisitConstant(SqlConstantExpression constant)
 {
     return SqlExpression.Constant(constant.Value);
 }
Example #16
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="constant"></param>
 /// <returns></returns>
 public virtual SqlExpression VisitConstant(SqlConstantExpression constant)
 {
     return(SqlExpression.Constant(constant.Value));
 }
Example #17
0
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            SetType(constant.Value.Type);

            return(base.VisitConstant(constant));
        }
Example #18
0
 public virtual SqlExpression VisitConstant(SqlConstantExpression expression)
 {
     return(SqlExpression.Constant(expression.Value));
 }
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            var value = constant.Value;
            if (value.IsNull)
                return constant;

            var obj = value.Value;
            if (obj is SqlQueryObject) {
                return EvaluateQueryPlan((SqlQueryObject) obj);
            }

            return base.VisitConstant(constant);
        }
        public override SqlExpression VisitConstant(SqlConstantExpression constant)
        {
            SetType(constant.Value.Type);

            return base.VisitConstant(constant);
        }