rahulch

Untitled

Oct 15th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. this->m_query.prepare(
  2.         "INSERT OR REPLACE INTO person (id, frID, gender, name, class, age, school) "
  3.         "VALUES ((SELECT id FROM person where frID = :frID), :frID, :gender, :name, :class, :age, :school)"
  4.     );
  5.     const int& frID = this->m_outputStructure.getFRID(0);
  6.     this->m_query.bindValue(":frID", frID);
  7.     this->m_query.bindValue(":name", this->m_databaseHashMap["name"]);
  8.     this->m_query.bindValue(":gender", this->m_databaseHashMap["gender"]);
  9.     this->m_query.bindValue(":age", this->m_databaseHashMap["age"]);
  10.     this->m_query.bindValue(":class", this->m_databaseHashMap["class"]);
  11.     this->m_query.bindValue(":school", this->m_databaseHashMap["school"]);
  12. bool ok = this->m_query.exec();
  13.     if (!ok)
  14.         qDebug() << "Could not save details - " << this->m_query.lastError().text();
Add Comment
Please, Sign In to add comment