QSqlQuery: results size are limited to 4095 bytes
Hi,
I have a problem about getting full result of a SQL query (using ODBC). This one like to be limited to 4095 bytes. I can't get a full picture from my database !
Details:
- The odbc seems to be well configured. I have tested it with a sql client (Aqua Data Studio) and it returns me a full result.
- I use the QSqlModel to perform my query.
- I encountered the same problem with long text (more than 4095).
What's wrong ?
THX !!
Re: QSqlQuery: results size are limited to 4095 bytes
Try with QSqlQueryModel::fetchMore.
Some models are optimized and they don't fetch all data.
Re: QSqlQuery: results size are limited to 4095 bytes
I didn't understand the fetchMore() function in QT Designer's help ^^
So thank you for your help, i'll try it after my holiday :)
Re: QSqlQuery: results size are limited to 4095 bytes
FetchMore didn't work. My problem concern only one row which size must be higher than 4095 bytes. I didn't found any parameter to add to my QSqlDatabase object, neither QSqlModel .... help :'(
Re: QSqlQuery: results size are limited to 4095 bytes
Show us the definition of the row and how you try to access the fields.
Re: QSqlQuery: results size are limited to 4095 bytes
Quote:
//Connection
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC3");
db.setDatabaseName(conf_database);
db.setUserName(conf_user);
db.setPassword(password);
db.setHostName("");
//Get the picture
QString rPhoto("select photo from individus where identifiant="+identifiant);
QSqlQueryModel modelPhoto;
modelPhoto.setQuery(rPhoto);
QFile test("d:/test_image.bmp");
test.open(QIODevice::WriteOnly);
test.write(modelPhoto.record(0).value("photo").toB yteArray()); //The size() function return 4095 ... but the picture is higher, about 22kB.
test.close();
Database: SYBASE 12.5
The ODBC is well configured, i tested it with another SQL Client which returns a full result.
The column is a "picture" datatype in Sybase.
Thx to try to help me ;)
Re: QSqlQuery: results size are limited to 4095 bytes
Have a search in this page for "ODBC 2.x" . Does setting ODBC 3 compatibility change the outcome?