Qt version: 4.3.0
Platform: Win, MacOS, Linux
DB Engine: SqLite
The below batch update returns with "Parameter count mismatch" error.
QSqlQuery query1(Db);
query1.prepare("UPDATE TEST_TABLE SET (COL1, COL2) VALUES(?, ?) WHERE ID IN (3, 4)");
QVariantList qvParam1, qvParam2;
qvlParam1.push_back(300);
qvlParam1.push_back(300);
qvlParam2.push_back(1);
qvlParam2.push_back(1);
query1.addBindValue(qvParam1);
query1.addBindValue(qvlParam2);
if (!query1.execBatch())
{
qDebug() << "Failed to batch update" << query1.lastError();
assert(0);
return false;
}
Whereas a query like this works just fine in batch execution.
"INSERT INTO TEST_TABLE(COL1, COL2) VALUES(?, ?)"
Please help.
Bookmarks