[SOLVED] Invalid precision value. QODBC3: Unable to bind variable (Using ODBC driver)
I'm trying to insert a large string (about 32k characters) to a Pervasive database using Qt ODBC driver. The database table is as follows:
CREATE TABLE "TABLE"(
And trying to insert a large string (variable name value) to it:
q.prepare("INSERT INTO TABLE(product_id, header, text) VALUES (:product, :header, :text);");
if (!q.exec()) std::cout << q.lastError().text().toStdString() << std::endl;
else std::cout << "SUCCESS!" << std::endl;
Gives the following error:
[Pervasive][ODBC Client Interface]Invalid precision value. QODBC3: Unable to bind variable
The limit is somewhere between 3000 and 4000 characters. I tried ti Google around, but found really nothing I could work with.. I guess it has something to do with the ODBC driver, but does anyone have any experience on how to work around this problem?
I've now pinpointed the exact length where the error occures, and it's exactly at 4000. If the string is over 4000 characters, the error will occur...
Solved by converting the QString to a QByteArray, and binding that.