protected override Sql.Builder Output(Sql.Builder sb) { sb.Append("insert into ", _table_name, " ("); int pos = 0; for (SqlBind cl = _cols; cl != null; cl = cl.Next) { if (pos++ > 0) sb.Comma(); sb.Append(cl.Column.Name); } sb.psingle = pos; //TODO!!! add const value fields. sb.Append(") values "); for (int i = 0; i < Math.Max(1, sb.Context.Boost); i++) { if (i > 0) sb.Comma(); pos = 0; sb.Append('('); for (SqlBind cl = _cols; cl != null; cl = cl.Next) { if (pos++ > 0) sb.Comma(); //-sb.AppendParam(cl); } sb.Append(')'); } return sb; }
protected override Sql.Builder Output(Sql.Builder sb) { sb.Append("update ", _table_name, " set "); int pos = 0; if (_update != null) sb.Append(_update); else for (SqlBind cl = _cols; cl != null; cl = cl.Next) { if (pos++ > 0) sb.Comma(); sb.Append(cl.Column.Name).Append('='); //-sb.AppendParam(cl); } if (_where == null) return sb; sb.Append(" where "); _where.Output(sb); return sb; }
internal override void Output(Sql.Builder sb) { int boost = sb.Context.Boost; if (boost < 2) { OutputEx(sb); return; } sb.psingle = 1; if (_keys.Next == null) { sb.Append(_keys.Column.Name, " in ("); for (int i = 0; i < boost; i++) { if (i > 0) sb.Comma(); //sb.AppendParam(_keys); } sb.Append(')'); return; } for (SqlBind ls = _keys; (ls = ls.Next) != null; sb.psingle++) ; sb.Append('('); for (int i = 0; i < boost; i++) { if (i > 0) sb.Append(")or("); OutputEx(sb); } sb.Append('('); }