Exemplo n.º 1
0
        // no statement building
#else
        //
        // SQL Statement builder
        //

        #region public override bool BuildStatement(DBStatementBuilder builder)

        public override bool BuildStatement(DBStatementBuilder builder)
        {
            if (string.IsNullOrEmpty(this.FunctionName))
            {
                return(false);
            }

            builder.BeginFunction(this.KnownFunction, this.FunctionName);
            builder.BeginFunctionParameterList();

            if (this.HasParameters)
            {
                int index = 0;
                foreach (DBClause p in this.Parameters)
                {
                    builder.BeginFunctionParameter(index);
                    p.BuildStatement(builder);
                    builder.EndFunctionParameter(index);
                    index++;
                }
            }
            builder.EndFunctionParameterList();

            builder.EndFunction(this.KnownFunction, this.FunctionName);

            if (string.IsNullOrEmpty(this.Alias) == false)
            {
                builder.WriteAlias(this.Alias);
            }

            return(true);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        // no statement building
#else
        //
        // SQL Statement building
        //

        #region public override bool BuildStatement(DBStatementBuilder builder)

        public override bool BuildStatement(DBStatementBuilder builder)
        {
            builder.BeginAggregateFunction(this.Function, this.Function.ToString());
            builder.BeginFunctionParameterList();

            if (this.InnerReference != null)
            {
                this.InnerReference.BuildStatement(builder);
            }

            builder.EndFunctionParameterList();
            builder.EndAggregateFunction(this.Function, this.Function.ToString());

            if (string.IsNullOrEmpty(this.Alias) == false)
            {
                builder.WriteAlias(this.Alias);
            }
            return(true);
        }