public void WhereEnsure(bool append_and_if_not_empty) { if (Where == null) { Where = new whereclause(); } if (Where.expressions == null) { Where.expressions = new expressionlist(); } /* [dlatikay 20091215] bugfix */ if (append_and_if_not_empty) { if (Where.expressions.Count > 0) { /* [dlatikay 20091215] bugfix on top: don't prefix AND if expression list already ends with AND */ if (!Where.expressions[Where.expressions.Count - 1].Equals(shortcuts.where_and)) { /* [dlatikay 20091215] and one more: tricky... must suffix, not prefix of course - was wrong: .Insert(0, ...) * [dlatikay 20170830] the existing clause can contain a naked OR, therefore we need to bracketize */ Where.expressions.Insert(0, shortcuts.where_bracketopen); Where.expressions.Add(shortcuts.where_bracketclose); Where.expressions.Add(shortcuts.where_and); } } } }
public selectstatement(int top, bool distinct, selectlist fields, tableexpressions tables, joinstatements joins, whereclause where) { Top = top; Distinct = distinct; Fields = fields; Tables = tables; Joins = joins; Where = where; }
public selectstatement(int top, bool distinct, selectlist fields, tableexpressions tables, joinstatements joins, whereclause where, groupbystatement group, whereclause having, orderbystatement order) { Top = top; Distinct = distinct; Fields = fields; Tables = tables; Joins = joins; Where = where; GroupBy = group; Having = having; OrderBy = order; }
public plainselect_update(selectlist fields, string table, whereclause where) { Top = 0; Distinct = false; Tables = new tableexpressions() { new tableexpression(table) }; Joins = null; Where = where; GroupBy = null; Having = null; OrderBy = null; Fields = fields; }
public updateselect(ddl db, Fields fields) { Top = 0; Distinct = false; Tables = null; Joins = null; Where = new whereclause(fields.PKQueryExpression(db)); GroupBy = null; Having = null; OrderBy = null; Fields = new selectlist(); foreach (Field f in fields) { if (!f.PrimaryKeyConstituent) { Fields.Add(new selectparam(db.MakeParamName(f.Name), f.Name, f.Type, f.Size)); } } }
public plainselect_where(string[] fields, string table, whereclause where) { Top = 0; Distinct = false; Tables = new tableexpressions() { new tableexpression(table) }; Joins = null; Where = where; GroupBy = null; Having = null; OrderBy = null; Fields = new selectlist(); foreach (string f in fields) { Fields.Add(new selectfield(f)); } }
public selectstatement(selectlist fields, tableexpressions tables, joinstatements joins, whereclause where) : this(0, false, fields, tables, joins, where, null, null, null) { //Top = 0; //Distinct = false; //Fields = fields; //Tables = tables; //Joins = joins; //Where = where; //GroupBy = null; //Having = null; //OrderBy = null; }
public selectstatement(selectlist fields, tableexpressions tables, joinstatements joins, whereclause where, groupbystatement group, whereclause having, orderbystatement order) : this(0, false, fields, tables, joins, where, group, having, order) { //Top = 0; //Distinct = false; //Fields = fields; //Tables = tables; //Joins = joins; //Where = where; //GroupBy = group; //Having = having; //OrderBy = order; }
public insertselect(selectlist fields, tableexpressions tables, joinstatements joins, whereclause where) : base(fields, tables, joins, where) { }
public insertselect(selectlist fields, tableexpressions tables, joinstatements joins, whereclause where, groupbystatement group, whereclause having, orderbystatement order) : base(fields, tables, joins, where, group, having, order) { }
public insertselect(int top, bool distinct, selectlist fields, tableexpressions tables, joinstatements joins, whereclause where) : base(top, distinct, fields, tables, joins, where) { }
public insertselect(int top, bool distinct, selectlist fields, tableexpressions tables, joinstatements joins, whereclause where, groupbystatement group, whereclause having, orderbystatement order) : base(top, distinct, fields, tables, joins, where, group, having, order) { }
public plainselect_where(string[] fields, Type table, whereclause where) : this(fields, table.Name, where) { }