我尝试在表中写入数据数组,但出现错误“参数计数不匹配”
auto query = new QSqlQuery(db);
request = QString("INSERT INTO items(id, type, data) VALUES"
"('%0', '%1', :bytes)").
arg(id).
arg(static_cast<int>(type));
// request: INSERT INTO items(id, type, data) VALUES('0', '512', :bytes)
query->prepare(request)); // ok
query->bindValue(":bytes", bytes); // bytes is qbytearray with data
query->exec(request) // error Parameter count mismatch
操作系统:ubuntu 18.04
Qt:5.12.3、5.9.7
如何正确写入数据?