QSqlQuery qry4;
QSqlQuery qry5;
QSqlQuery qry6;
qry3.prepare("INSERT INTO apra(Source,Medium,Subject,'Date & Time received document','Date & Time RRO forwarded to HOO','ControlNo.') values('"+src+"','"+med+"','"+key+"','"+one+"','"+one+"','"+res+"')");
qry4.prepare("INSERT INTO bag(Source,Medium,Subject,'Date & Time received document','Date & Time RRO forwarded to HOO','ControlNo.') values('"+src+"','"+med+"','"+key+"','"+one+"','"+one+"','"+res+"')");
qry5.prepare("INSERT INTO ben(Source,Medium,Subject,'Date & Time received document','Date & Time RRO forwarded to HOO','ControlNo.') values('"+src+"','"+med+"','"+key+"','"+one+"','"+one+"','"+res+"')");
qry6.prepare("INSERT INTO cent(Source,Medium,Subject,'Date & Time received document','Date & Time RRO forwarded to HOO','ControlNo.') values('"+src+"','"+med+"','"+key+"','"+one+"','"+one+"','"+res+"')");
if(qry3.exec()){
QMessageBox::information(this,"Database","qry3");
}else{
QMessageBox::critical(this,tr("error::"),qry3.lastError().text());
}
if(qry4.exec()){
QMessageBox::information(this,"Database","qry4");
}else{
QMessageBox::critical(this,tr("error::"),qry4.lastError().text());
}
if(qry5.exec()){
QMessageBox::information(this,"Database","qry5");
}else{
QMessageBox::critical(this,tr("error::"),qry5.lastError().text());
}
if(qry6.exec()){
QMessageBox::information(this,"Database","qry6");
}else{
QMessageBox::critical(this,tr("error::"),qry6.lastError().text());
}
Я хочу знать более простой способ обновления таблиц в sqlite. Поскольку этот метод выдает информационное приглашение 3 раза, а что если у меня 10 и более запросов, это займет много времени и не будет идеальным.