Hello every one i have am trying to insert some 550 channels of data to sqlite db. This is the code i am using to update. every thing is but i am having a problem in the place where i am appending the data into the finaldatabuff, i am trying to increment columncount till 550 and then insert the 550 channels data into the db. But here even after the columncount counter cross's 550, the condition if(columncount == 550) is not satisfied and the query is not executed at all. .. in case i remove the if(columncount == 550) condition all the data is saved into the db but it is repeated.. what do you think is going wrong , why is the if condition not satisfied... ?
Qt Code:
  1. void datareceiver::insertdb()
  2. {
  3. timer8->stop();
  4. for(int p = 0; p < temperaturedata.count();p++)
  5. {
  6. QVector<QString> *v111 = new QVector<QString>();
  7. finaldatabuff << v111;
  8. //for(rd = 0 ; rd < 550;rd++)
  9. //{
  10. for(int q = 0; q < temperaturedata[p]->count(); q++)
  11. {
  12. finaldatabuff[finaldatabuff.count()-1]->append(temperaturedata[p]->at(q));
  13. columncount++; // incremented untill 550
  14.  
  15. }
  16. }
  17.  
  18. if(columncount == 550) // when columncount=550 insert 550 channels the data into the db .
  19. {
  20. m_query.exec("begin transaction Trans");
  21. QTime startTime = QTime::currentTime();
  22. for (int i = 0; i < finaldatabuff.count(); ++i)
  23. {
  24. QString sQuery = "insert into thdata";
  25. sQuery += " values (";
  26. for (int j = 0; j < finaldatabuff[i]->count(); ++j)
  27. sQuery += QString("%1").arg(finaldatabuff[i]->at(j)) + ", ";
  28. sQuery.remove(sQuery.length() - 2, 2);
  29. sQuery += ")";
  30. q.exec(sQuery);
  31. if(!m_query.exec(sQuery))
  32. {
  33. qDebug() << m_query.lastError().text();
  34. }
  35. }
  36.  
  37. m_query.exec("commit transaction Trans");
  38. columncount=0;
  39. for(int i = 0; i < finaldatabuff.size(); ++i)
  40. delete finaldatabuff[i];
  41. finaldatabuff.clear();
  42.  
  43. for(int i = 0; i < temperaturedata.size(); ++i)
  44. delete temperaturedata[i];
  45. temperaturedata.clear();
  46. timer8->start(2000);
  47. }
  48. }
To copy to clipboard, switch view to plain text mode 

pls help me out tell me what could be going wrong. ..

thank you,