query.bindValue(":RemoteName", RemoteName);
query.bindValue(":Purpose", Purpose);
query.bindValue(":Date", Date);
query.bindValue(":Value", Value );
query.bindValue(":Currency", Currency);
return query.exec();
}
q.prepare("INSERT INTO onlinebankingdata ("
"RemoteName,"
"Purpose,"
"Date,"
"Value,"
"Currency)"
"VALUES ("
":RemoteName,"
":Purpose,"
":Date,"
":Value,"
":Currency)");
for(int i=0;i<...;++i){
populateSQL(q, ...);
}
bool populateSQL(QSqlQuery query, QString RemoteName,QString Purpose,QString Date,double Value ,QString Currency) {
query.bindValue(":RemoteName", RemoteName);
query.bindValue(":Purpose", Purpose);
query.bindValue(":Date", Date);
query.bindValue(":Value", Value );
query.bindValue(":Currency", Currency);
return query.exec();
}
QSqlQuery q;
q.prepare("INSERT INTO onlinebankingdata ("
"RemoteName,"
"Purpose,"
"Date,"
"Value,"
"Currency)"
"VALUES ("
":RemoteName,"
":Purpose,"
":Date,"
":Value,"
":Currency)");
for(int i=0;i<...;++i){
populateSQL(q, ...);
}
To copy to clipboard, switch view to plain text mode
Bookmarks