Ejemplo n.º 1
0
        public override void WriteTo(IndentedTextWriter writer)
        {
            var initialIndent = writer.Indent;

            writer.Write("CREATE FUNCTION ");
            FunctionName.WriteTo(writer);

            // parameters
            writer.Write(" (");
            WriteParameters(writer);
            writer.WriteLine(')');

            writer.Indent++;
            try
            {
                // returns
                writer.Write("RETURNS ");
                Returns.WriteTo(writer);
                writer.WriteLine();

                // definition
                writer.Write("AS ");
                Definition.WriteTo(writer);
            }
            finally
            {
                writer.Indent--;
            }
            writer.WriteLine();
        }