You can use the database build in functions if your strings aren't too long. MySQL e.g supports
Qt Code:
  1. q.prepare("...SET name = SUBSTRING(:str,0,:len)...");
  2. for(int i =0; i < sizeof(i_fieldlength)/sizeof(i_fieldlength[0]);++i)
  3. {
  4. q.bindValue(":str", splitlinelist.at(i));
  5. q.bindValue(":len", i_fieldlength[i]);
  6. q.exec();
  7. }
To copy to clipboard, switch view to plain text mode 

NOTE: sizeof(i_fieldlength)/sizeof(i_fieldlength[0]) and ++i!

EDIT: splitlinelist.at(i) => at() is constant so you can't assign a value to that. If you want to use the [] operator.