How to add data to multiple tables in sqlite in c++?
Unsolved
General and Desktop
-
I am getting error by using this code
"No query unable to fetch row"I am trying to insert the data to two tables but 'qry2' is getting that error. I am using this to insert data, is this right?
QSqlQuery qry; QSqlQuery qry2; qry.prepare("INSERT INTO first(Source,Medium,Subject,'Date & Time received document','Date & Time RRO forwarded to HOO','ControlNo.') values('"+src+"','"+med+"','"+key+"','"+one+"','"+one+"','"+res+"')"); qry2.prepare("INSERT INTO second(Source,Medium,Subject,'Date & Time received document','Date & Time RRO forwarded to HOO','ControlNo.') values('"+src+"','"+med+"','"+key+"','"+one+"','"+one+"','"+res+"')");
Yes I am inserting the same data to both tables. Can you help me?