Hello,

I would like to update a BLOB field in my database with a QByteArray, but it doesn't work. Can you help me ?

Ma database structure is :

CREATE TABLE Settings (
Version nvarchar(10),
Geometry BLOB
);

This database have 1 row :

INSERT INTO Settings VALUES (
'0.1',
''
);

and I would like to update this row with the following source code :

// connection :
< database connection code >

// update :
QByteArray a_value;
a_value = saveGeometry(); // saveGeometry return a QByteArray

QSqlQuery query;
query.prepare("UPDATE Settings SET Geometry = ':Geometry'");
query.bindValue(":Geometry", a_value);
if (query.exec() == false)
qDebug() << "Error SQL exec()";


The result is : Error SQL exec()

Thanks