Hi!

In my code I have several QSqlQuery statements, each has different name and are used for selecting data and updating that data. When I select data from a table using the select query I caould not update that same table using update query until I cleared that query using QsqlQuery::clear(). Why is that necessary?

Example code (not necessary working, just to see what I meant):
Qt Code:
  1. QSqlQuery q_select1("SELECT * FROM table1 WHERE number LIKE '1'");
  2. int i_word = q_select1.record().value("word");
  3. q_select1.next();
  4. QString s_word = q_select1.value(i_word);
  5.  
  6. q_select1.clear();
  7.  
  8. QSqlQuery q_update1("UPDATE table1 SET word = 'new word' WHERE number = '1'");
To copy to clipboard, switch view to plain text mode 
Why the q_update1 did not work until i put q_select1 there?

Thanks!
Luka