Example #1
0
        private void WriteGroupBy(ParserWriter writer, APSqlGroupByClause clause, OracleCommand dbCmd)
        {
            if (clause != null && clause.Next != null)
            {
                writer.WriteLine();
                writer.WriteDirect("GROUP BY");

                APSqlExprPhrase phrase  = clause.Next as APSqlExprPhrase;
                bool            isFirst = true;
                while (phrase != null)
                {
                    if (!isFirst)
                    {
                        writer.Write(',');
                    }
                    else
                    {
                        isFirst = false;
                    }

                    WriteSelectExpression(writer, phrase.Expr);
                    //writer.Write(phrase.Expr.SelectExpr);

                    phrase = phrase.Next as APSqlExprPhrase;
                }
            }
        }
Example #2
0
 /// <summary>
 /// SQL 'GROUP BY' clause extensions.
 /// </summary>
 /// <param name="command">The command.</param>
 /// <param name="clause">The 'GROUP BY' clause.</param>
 /// <returns>The command.</returns>
 public static APSqlSelectCommand group_by(this APSqlSelectCommand command, APSqlGroupByClause clause)
 {
     command.GroupByClause = clause;
     return(command);
 }
Example #3
0
		private void WriteGroupBy(ParserWriter writer, APSqlGroupByClause clause, SqlCommand dbCmd)
		{
			if (clause != null && clause.Next != null)
			{
				writer.WriteLine();
				writer.WriteDirect("GROUP BY");

				APSqlExprPhrase phrase = clause.Next as APSqlExprPhrase;
				bool isFirst = true;
				while (phrase != null)
				{
					if (!isFirst)
						writer.Write(',');
					else
						isFirst = false;

					WriteSelectExpression(writer, phrase.Expr);
					//writer.Write(phrase.Expr.SelectExpr);

					phrase = phrase.Next as APSqlExprPhrase;
				}
			}
		}