Пример #1
0
		public override void WriteToStream(IndentStream stream)
		{
			stream.Write("DELETE");

			if (TopExpr != null)
			{
				stream.Write(" ");
				TopExpr.WriteToStream(stream);
			}

			stream.Write(" FROM ");
			Table.WriteToStream(stream);

			if (WithOptions != null && WithOptions.Count > 0)
			{
				stream.Write(" WITH(");
				WithOptions.WriteToStreamWithComma(stream);
				stream.Write(")");
			}

			if (OutputList != null && OutputList.Count > 0)
			{
				stream.WriteLine();
				stream.Write("OUTPUT ");
				OutputList.WriteToStreamWithComma(stream);
			}

			if (IntoTableExpr != null)
			{
				stream.WriteLine();
				IntoTableExpr.WriteToStream(stream);
			}

			if (OutputList1 != null && OutputList1.Count > 0)
			{
				stream.WriteLine();
				stream.Write("OUTPUT ");
				OutputList.WriteToStreamWithComma(stream);
			}

			if (FromSourceList != null && FromSourceList.Count > 0)
			{
				stream.WriteLine();
				stream.Write("FROM ");
				FromSourceList.WriteToStreamWithComma(stream);
			}

			if (WhereExpr != null)
			{
				stream.WriteLine();
				stream.Write("WHERE ");
				WhereExpr.WriteToStream(stream);
			}

			if (OptionExpr != null)
			{
				stream.WriteLine();
				OptionExpr.WriteToStream(stream);
			}
		}
Пример #2
0
        public override void WriteToStream(IndentStream stream)
        {
            stream.Write("INSERT INTO ");
            Table.WriteToStream(stream);

            if (ColumnsList != null && ColumnsList.Count > 0)
            {
                stream.Write("(");
                ColumnsList.WriteToStreamWithComma(stream);
                stream.Write(")");
            }

            if (WithExpr != null)
            {
                stream.Write(" ");
                WithExpr.WriteToStream(stream);
            }

            if (OutputList != null && OutputList.Count > 0)
            {
                stream.WriteLine();
                stream.Write("OUTPUT ");
                OutputList.WriteToStreamWithComma(stream);
            }

            if (OutputIntoExpr != null)
            {
                stream.WriteLine();
                OutputIntoExpr.WriteToStream(stream);
            }

            stream.WriteLine();
            SelectFromExpr.WriteToStream(stream);
        }
Пример #3
0
        public override void WriteToStream(IndentStream stream)
        {
            stream.Write("UPDATE");

            if (TopCount != null)
            {
                stream.Write(" ");
                TopCount.WriteToStream(stream);
            }

            if (Table != null)
            {
                stream.Write(" ");
                Table.WriteToStream(stream);
            }

            if (WithOptions != null && WithOptions.Count > 0)
            {
                stream.Write(" WITH(");
                WithOptions.WriteToStreamWithComma(stream);
                stream.Write(")");
            }

            stream.Write(" SET ");
            SetColumnsList.WriteToStreamWithComma(stream);

            if (OutputList != null && OutputList.Count > 0)
            {
                stream.WriteLine();
                stream.Write("OUTPUT ");
                OutputList.WriteToStreamWithComma(stream);
            }

            if (IntoExpr != null)
            {
                stream.WriteLine();
                IntoExpr.WriteToStream(stream);
            }

            if (FromTableList != null && FromTableList.Count > 0)
            {
                stream.WriteLine();
                stream.Write("FROM ");
                FromTableList.WriteToStreamWithComma(stream);
            }

            if (WhereExpr != null)
            {
                stream.WriteLine();
                stream.Write("WHERE ");
                WhereExpr.WriteToStream(stream);
            }
        }