Esempio n. 1
0
        /// <summary>Renders the clause in textual representation. </summary>
        /// <param name="writer">to output to</param>
        /// <param name="formatter">for NewLine-whitespace formatting</param>
        /// <param name="isTopLevel">to indicate if this insert-into-clause is inside other clauses.</param>
        public void ToEPL(
            TextWriter writer,
            EPStatementFormatter formatter,
            bool isTopLevel)
        {
            formatter.BeginInsertInto(writer, isTopLevel);
            writer.Write("insert ");
            if (StreamSelector != StreamSelector.ISTREAM_ONLY)
            {
                writer.Write(StreamSelector.GetEPL());
                writer.Write(" ");
            }

            writer.Write("into ");
            writer.Write(StreamName);

            if (ColumnNames.Count > 0)
            {
                writer.Write("(");
                string delimiter = "";
                foreach (var name in ColumnNames)
                {
                    writer.Write(delimiter);
                    writer.Write(name);
                    delimiter = ", ";
                }

                writer.Write(")");
            }
        }