PythonqueryFIO = QtSql.QSqlQuery(connection)queryFIO.exec("SELECT FAM, IM, OT FROM FIOTABLE")queryBBB = QtSql.QSqlQuery(connection)queryBBBtext = "SELECT BUM, BAM, BOM FROM BUMTABLE WHERE FAM = ? and IM = ? and OT = ?"while queryFIO.next(): record = query.record() A_FAM = record.value("FAM") A_IM = record.value("IM") A_OT = record.value("OT") queryBBB.prepare(queryBBBtext) queryBBB.bindValue(A_FAM) queryBBB.bindValue(A_IM) queryBBB.bindValue(A_OT) queryBBB.exec_()
Values cannot be bound to multiple locations in the query, eg:INSERT INTO testtable (id, name, samename) VALUES (:id, :name, :name)Binding to name will bind to the first :name, but not the second.