Hey all, I'm having a problem, using this:
Qt Code:
  1. QSqlQuery peticion(enlace);
  2. QString SQL("UPDATE mercaderias SET :1 = :4 WHERE Nombre=:3 AND Proveedor=:4");
  3. QString columna;
  4. switch(uno.column()) {
  5. case 0:
  6. columna="Nombre";
  7. break;
  8. case 1:
  9. columna="Proveedor";
  10. break;
  11. case 2:
  12. columna="Cantidad";
  13. break;
  14. case 3:
  15. columna="Precio";
  16. break;
  17. }
  18. peticion.prepare(SQL);
  19. peticion.bindValue(":1",columna);
  20. peticion.bindValue(":2",uno.data().toString());
  21. peticion.bindValue(":3",ui->Tabla->model()->index(uno.row(),0).data().toString());
  22. peticion.bindValue(":4",ui->Tabla->model()->index(uno.row(),2).data().toString());
  23.  
  24. if ( !peticion.exec() ) {
  25. qDebug() << "Error al actualizar";
  26. qDebug() << peticion.executedQuery();
  27. qDebug() << peticion.lastError().text();
  28. }
To copy to clipboard, switch view to plain text mode 

peticion.executedQuery() returns the values inside quotes (like 'value') instead of them being raw. What can I do to fix this?