@greenhand said in I cannot modify orcale table data using the qsqltablemodel class.:
and then use void tableeditor:: submit() function to submit
I don't know why you do that, or whether it does anything given that you are using your own QSqlQuery for the data modification.
The idea was to to compare whatever UPDATE statement you compose manually for QSqlQuery, which works, against whatever QTableModel issues for its UPDATE (however you discover that) to see if you can spot a difference.
Next you might try QSqlQueryModel instead of QSqlTableModel, building up from QSqlQuery which you say does work.
Just in case it makes any difference:
if (model->submitAll()) {
model->database().commit();
} else {
model->database().rollback();
QMessageBox::warning(this, tr("Cached Table"),
tr("The database reported an error: %1")
.arg(model->lastError().text()));
}
Output, or save up, model->lastError().text() as the first thing in the else, so it definitely reports what came from model->submitAll() failing and cannot be potentially altered by the model->database().rollback();.