Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this->m_query.prepare(
- "INSERT OR REPLACE INTO person (id, frID, gender, name, class, age, school) "
- "VALUES ((SELECT id FROM person where frID = :frID), :frID, :gender, :name, :class, :age, :school)"
- );
- const int& frID = this->m_outputStructure.getFRID(0);
- this->m_query.bindValue(":frID", frID);
- this->m_query.bindValue(":name", this->m_databaseHashMap["name"]);
- this->m_query.bindValue(":gender", this->m_databaseHashMap["gender"]);
- this->m_query.bindValue(":age", this->m_databaseHashMap["age"]);
- this->m_query.bindValue(":class", this->m_databaseHashMap["class"]);
- this->m_query.bindValue(":school", this->m_databaseHashMap["school"]);
- bool ok = this->m_query.exec();
- if (!ok)
- qDebug() << "Could not save details - " << this->m_query.lastError().text();
Add Comment
Please, Sign In to add comment