Пример #1
0
        // no statement building
#else
        //
        // SQL Statement building
        //

        #region public override bool BuildStatement(DBStatementBuilder builder)

        public override bool BuildStatement(DBStatementBuilder builder)
        {
            if (null != this.All && this.All.Length > 0)
            {
                builder.BeginBlock();
                bool first = true;
                foreach (DBComparison comp in this.All)
                {
                    if (first)
                    {
                        first = false;
                    }
                    else
                    {
                        builder.WriteOperator(this.Operation);
                    }

                    comp.BuildStatement(builder);
                }

                builder.EndBlock();
                return(true);
            }
            return(false);
        }
Пример #2
0
        // no statement building
#else
        //
        // SQL Statement builder
        //

        #region public override bool BuildStatement(DBStatementBuilder builder,bool isInorNot=false)

        public override bool BuildStatement(DBStatementBuilder builder, bool isInorNot = false)
        {
            builder.BeginBlock();
            this.GroupItems.BuildStatement(builder);
            builder.EndBlock();
            return(true);
        }
Пример #3
0
        // no statement building
#else
        //
        // SQL Statement builder
        //

        #region public override bool BuildStatement(DBStatementBuilder builder)

        public override bool BuildStatement(DBStatementBuilder builder)
        {
            builder.BeginBlock();
            Left.BuildStatement(builder);
            builder.WriteOperator((Operator)this.Operator);
            Right.BuildStatement(builder);
            builder.EndBlock();
            return(true);
        }
Пример #4
0
        // no statement building
#else
        //
        // SQL Statement builder
        //

        #region public override bool BuildStatement(DBStatementBuilder builder)

        public override bool BuildStatement(DBStatementBuilder builder)
        {
            builder.BeginBlock();
            this.CompareTo.BuildStatement(builder);
            builder.BeginTertiaryOperator((Operator)this.TertiaryOperator);
            this.MinValue.BuildStatement(builder);
            builder.ContinueTertiaryOperator((Operator)this.TertiaryOperator);
            this.MaxValue.BuildStatement(builder);
            builder.EndTertiaryOperator((Operator)this.TertiaryOperator);
            builder.EndBlock();

            return(true);
        }
Пример #5
0
        // no statement building
#else
        //
        // SQL Statement builder
        //

        #region public override bool BuildStatement(DBStatementBuilder builder)

        public override bool BuildStatement(DBStatementBuilder builder, bool isInorNot = false)
        {
            builder.BeginBlock();
            this.Left.BuildStatement(builder);
            builder.WriteOperator((Operator)this.BinaryOp);
            this.Right.BuildStatement(builder);
            builder.EndBlock();
            if (string.IsNullOrEmpty(this.Alias) == false)
            {
                builder.WriteAlias(this.Alias);
            }
            return(true);
        }
Пример #6
0
        // no statement building
#else
        public override bool BuildStatement(DBStatementBuilder builder, bool isInorNot = false)
        {
            builder.BeginCreate(DBSchemaTypes.Index, string.Empty, this.Name, string.Empty, false);
            builder.BeginBlock(false);
            foreach (DBOrder order in this.ColumnOrders)
            {
                builder.BeginOrderClause(order.Order);
                order.Clause.BuildStatement(builder);
                builder.EndOrderClause(order.Order);
            }
            builder.EndBlock(false);
            builder.EndCreate(DBSchemaTypes.Index, false);
            return(true);
        }
Пример #7
0
        // no statement building
#else
        public override bool BuildStatement(DBStatementBuilder builder)
        {
            string opts = GetConstraints(builder);

            builder.BeginCreate(DBSchemaTypes.Index, this.Owner, this.Name, opts, this.CheckExists == DBExistState.NotExists);
            builder.BeginReferenceOn();
            builder.WriteSourceTable(this.TableOwner, this.TableName, string.Empty);
            builder.EndReferenceOn();
            builder.BeginBlock();
            this.ColumnOrders.BuildStatement(builder);
            builder.EndBlock();
            builder.EndCreate(DBSchemaTypes.Index, this.CheckExists == DBExistState.NotExists);
            return(true);
        }
Пример #8
0
        // no statement building
#else
        //
        // SQL Statement builder
        //

        #region public override bool BuildStatement(DBStatementBuilder builder)

        public override bool BuildStatement(DBStatementBuilder builder)
        {
            if (this.ToOperateOn != null)
            {
                builder.BeginBlock();
                builder.WriteOperator((Operator)this.UnaryOperator);
                this.ToOperateOn.BuildStatement(builder);
                builder.EndBlock();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #9
0
        // no statement building
#else
        #region protected virtual void BuildColumnListStatement(DBStatementBuilder builder, DBColumnList tooutput)

        /// <summary>
        /// Generates the SQL statement for a list of columns outputting only their names
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="tooutput"></param>
        protected virtual void BuildColumnListStatement(DBStatementBuilder builder, DBColumnList tooutput)
        {
            builder.BeginBlock();
            bool first = true;

            foreach (DBColumn col in tooutput)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    builder.WriteReferenceSeparator();
                }
                builder.WriteSourceField(string.Empty, string.Empty, string.Empty, col.Name, string.Empty);
            }
            builder.EndBlock();
        }
Пример #10
0
        // no statement building
#else
        //
        // SQL Statement builder
        //

        #region public override bool BuildStatement(DBStatementBuilder builder)

        public override bool BuildStatement(DBStatementBuilder builder, bool isInorNot = false)
        {
            builder.BeginBlock();
            this.Left.BuildStatement(builder);
            builder.WriteOperator((Operator)this.CompareOperator);

            if ((Operator)this.CompareOperator == Operator.In || (Operator)this.CompareOperator == Operator.NotIn)
            {
                this.Right.BuildStatement(builder, true);
            }
            else
            {
                this.Right.BuildStatement(builder);
            }


            builder.EndBlock();

            return(true);
        }
Пример #11
0
        // no statement building
#else
        public override bool BuildStatement(DBStatementBuilder builder)
        {
            bool checknotexists = this.CheckExists == DBExistState.NotExists;

            builder.BeginCreate(DBSchemaTypes.Table, this.TableOwner, this.TableName, string.Empty, checknotexists);

            builder.BeginBlock(true);

            this.Columns.BuildStatement(builder, true, true);

            if (this.HasConstraints)
            {
                builder.BeginTableConstraints();
                this.ConstraintList.BuildStatement(builder, true, true);
                builder.EndTableConstraints();
            }

            builder.EndBlock(true);
            builder.EndCreate(DBSchemaTypes.Table, checknotexists);
            return(true);
        }
Пример #12
0
        // no statement building
#else
        //
        // SQL Statement builder
        //

        #region public override bool BuildStatement(DBStatementBuilder builder)

        public override bool BuildStatement(DBStatementBuilder builder, bool isInorNotIn = false)
        {
            if (this.ToOperateOn != null)
            {
                builder.BeginBlock();
                builder.WriteOperator((Operator)this.UnaryOperator);
                if ((Operator)this.UnaryOperator == Operator.In || (Operator)this.UnaryOperator == Operator.NotIn)
                {
                    this.ToOperateOn.BuildStatement(builder, true);
                }
                else
                {
                    this.ToOperateOn.BuildStatement(builder);
                }
                builder.EndBlock();
                return(true);
            }
            else
            {
                return(false);
            }
        }