Hi ..
I would like to know if there's a class in Qt that hold the sql exceptions ..
when I want to delete or update data .. I would like to hold the sql error due to constraint as foreign keys !!
thx...
Hi ..
I would like to know if there's a class in Qt that hold the sql exceptions ..
when I want to delete or update data .. I would like to hold the sql error due to constraint as foreign keys !!
thx...
The closest thing I found was QSqlError::number(), which always returns -1 in case of PostgreSQL, and QSqlError::type(), which, in case of a PosgreSQL constraint violation, returns QSqlError::StatementError. I would also like to have more differentiation between various SQL errors.
returning these 2 items usually works well for me to figure out what happened:
QSqlError::databaseText ()
QSqlError::driverText ()
Usually these are more verbose and complete error messages.
yuriry (10th October 2008)
Bookmarks