コード例 #1
0
        // no statement building
#else
        public override bool BuildStatement(DBStatementBuilder builder, bool isInorNot = false)
        {
            bool check = (this.CheckExists == DBExistState.NotExists);

            builder.BeginCreate(DBSchemaTypes.View, this.ViewOwner, this.ViewName, string.Empty, check);
            builder.BeginEntityDefinition();
            this.Select.BuildStatement(builder);
            builder.EndEntityDefinition();
            builder.EndCreate(DBSchemaTypes.View, check);
            return(true);
        }
コード例 #2
0
        // no statement building
#else
        public override bool BuildStatement(DBStatementBuilder builder, bool isInorNot = false)
        {
            bool checknotexists = (this.CheckExists == DBExistState.NotExists);

            builder.BeginCreate(DBSchemaTypes.StoredProcedure, this.Owner, this.Name, string.Empty, checknotexists);
            builder.StopRegisteringParameters();
            try
            {
                if (this.HasParameters)
                {
                    builder.BeginProcedureParameters();
                    bool outputSeparator = false;
                    foreach (DBParam p in this.Parameters)
                    {
                        if (outputSeparator)
                        {
                            builder.WriteReferenceSeparator();
                        }
                        builder.WriteSpace();
                        builder.WriteParameter(p, true);
                        outputSeparator = true;
                    }
                    builder.EndProcedureParameters();
                }
                builder.BeginNewLine();
                builder.BeginEntityDefinition();
                if (this.Script != null)
                {
                    this.Script.BuildStatement(builder);
                }
                builder.EndEntityDefinition();

                builder.EndCreate(DBSchemaTypes.StoredProcedure, checknotexists);
            }
            finally
            {
                builder.ResumeRegisteringParameters();
            }
            //Clear the parameters as we are declaring them rather than actually using them
            return(true);
        }