begin = ( "INSERT INTO " + agency + "(agency_name, flats_date, room_cod, sale_name" ", region_name, street_name, So, Sz, Sk, flats_floor, flats_floorest" ", material_short, plan_short, wc_short, balcon_short, flats_price, flats_cod, flats_tel " ", type_s, side_name, cond_short, agent_name, flats_confid, flats_pm2, flats_comments, sale, flats_ex) SELECT g.agency_name, f.flats_date, r.room_cod, k.sale_name" ", a.region_name, s.street_name, f.So, f.Sz, f.Sk, f.flats_floor, f.flats_floorest" ", m.material_short, p.plan_short, w.wc_short, b.balcon_short, (f.flats_price + " + txtMarket + ")*" + txtCurss + ", f.flats_cod, f.flats_tel " ", t.type_s, d.side_name, l.cond_short, n.agent_name, f.flats_confid, (f.flats_price/f.So)*" + txtCurss + ", f.flats_comments, f.sale, f.flats_ex " "FROM tbl_flats f, tbl_type t, tbl_sale k, tbl_room r," + tblroom + tblregion + tblstreet + tblplan + "tbl_region a, tbl_street s, tbl_wc w, tbl_balcon b, tbl_side d, tbl_cond l," + tblwc + tblbalcon + tblmaterial + tblagenci + "tbl_material m, tbl_agency g, tbl_agent n, tbl_plan p " "WHERE f.type_cod = t.type_cod AND f.room_cod = r.room_cod " + room + balcon + material + agenci + " AND f.sale_cod = k.sale_cod AND f.street_cod = s.street_cod" + region + street + plan + wc + " AND s.region_cod = a.region_cod AND f.agent_cod = n.agent_cod AND n.agency_cod = g.agency_cod" " AND f.wc_cod = w.wc_cod AND f.plan_cod = p.plan_cod AND f.balcon_cod = b.balcon_cod" " AND f.material_cod = m.material_cod AND f.side_cod = d.side_cod AND f.cond_cod = l.cond_cod"modelQuery->setQuery( begin );
wheres.append( QString( "( %1 = ? )" ).arg( name ) );binds.append( *it );