Hi!
Me again with my database based problems.
I have opened two databases in order to transfer data from one database to another. I declare first query as:
QSqlQuery query_read
("SELECT * FROM groups", db1
);
int is_kat = query_read.record().indexOf("group");
while(query_read.next()) {
QString s_kat
= query_read.
value(is_kat
).
toString();
//some code + declaration for another query
}
QSqlQuery query_read("SELECT * FROM groups", db1);
int is_kat = query_read.record().indexOf("group");
while(query_read.next()) {
QString s_kat = query_read.value(is_kat).toString();
//some code + declaration for another query
}
To copy to clipboard, switch view to plain text mode
The second query is declared inside the marked area like this:
query_write.prepare("INSERT INTO kat (kategories) VALUES (:kategorie)");
query_write.bindValue(":kategorija", s_kat);
query_write.exec();
QSqlQuery query_write(db2);
query_write.prepare("INSERT INTO kat (kategories) VALUES (:kategorie)");
query_write.bindValue(":kategorija", s_kat);
query_write.exec();
To copy to clipboard, switch view to plain text mode
Compiling does not return any error, but the data is not transfered. Where is the error?
Regards,
Luka
Bookmarks