예제 #1
0
        // no statement building
#else
        public override bool BuildStatement(DBStatementBuilder builder)
        {
            if (string.IsNullOrEmpty(this.Owner) == false)
            {
                builder.BeginIdentifier();
                builder.WriteObjectName(this.Owner);
                builder.EndIdentifier();
                builder.AppendIdSeparator();
            }
            builder.BeginIdentifier();
            builder.WriteObjectName(this.SequenceName);
            builder.EndIdentifier();
            builder.AppendIdSeparator();
            builder.BeginFunction(this.KnownFunction, string.Empty);

            builder.BeginFunctionParameterList();
            if (this.HasParameters)
            {
                this.Parameters.BuildStatement(builder);
            }
            builder.EndFunctionParameterList();

            builder.EndFunction(this.KnownFunction, string.Empty);

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Overrides the base implementation to generate the SQL statement for this EXEC query
        /// </summary>
        /// <param name="builder">The builder to use to generate the execute statement</param>
        /// <returns>true</returns>
        public override bool BuildStatement(DBStatementBuilder builder)
        {
            builder.BeginExecuteStatement();
            if (string.IsNullOrEmpty(this.Catalog) == false)
            {
                builder.BeginIdentifier();
                builder.WriteObjectName(this.Owner);
                builder.EndIdentifier();
                builder.AppendIdSeparator();
            }

            if (string.IsNullOrEmpty(this.Owner) == false)
            {
                builder.BeginIdentifier();
                builder.WriteObjectName(this.Owner);
                builder.EndIdentifier();
                builder.AppendIdSeparator();
            }
            else if (string.IsNullOrEmpty(this.Catalog) == false)
            {
                builder.AppendIdSeparator(); //need to include the dot - [Catalog]..[SprocName]
            }

            builder.BeginIdentifier();
            builder.WriteObjectName(this.SprocName);
            builder.EndIdentifier();


            if (this.HasParameters)
            {
                builder.BeginExecuteParameters();
                foreach (DBClause c in this.Parameters)
                {
                    builder.BeginExecuteAParameter();
                    c.BuildStatement(builder);
                    builder.EndExecuteAParameter();
                }
                builder.EndExecuteParameters();
            }

            if (this.IsInnerQuery == false)
            {
                builder.EndExecuteStatement();
            }

            return(true);
        }
예제 #3
0
        //No Statement building
#else
        /// <summary>
        /// Writes this use statement to the builder
        /// </summary>
        /// <param name="builder"></param>
        /// <returns></returns>
        public override bool BuildStatement(DBStatementBuilder builder)
        {
            builder.BeginUseStatement();
            builder.BeginIdentifier();
            builder.WriteObjectName(this.DBName);
            builder.EndIdentifier();
            builder.EndUseStatement();
            return(true);
        }
예제 #4
0
        // no statement building
#else
        public override bool BuildStatement(DBStatementBuilder builder)
        {
            builder.BeginIdentifier();
            builder.WriteObjectName(this.Name);
            builder.EndIdentifier();
            builder.WriteSpace();
            builder.WriteColumnDataType(this.Type, this.Length, this.Precision, this.Flags);
            builder.WriteColumnFlags(this.Flags, this.DefaultValue);

            return(true);
        }