Ejemplo 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);
        }