2010/3/28 IloChab <[email protected]>:
> I tried in this way:
>
> blobField = QtCore.QVariant ( QtCore.QByteArray ([1,2,3,]) )
> query = QtSql.QSqlQuery()
> query.prepare("""INSERT INTO blobTable (blobColumn) VALUES(?)""")
> query.bindValue(0,(blobField,));
> query.exec_();
>
>
> ... and I got no error, but in the DB I find an empty field: (u'')
>
>
> Which is the correct syntax to store a blob field???
>



The right way to do it was:


blobField = QtCore.QByteArray ([1,2,3,])
query = QtSql.QSqlQuery()
query.prepare("""INSERT INTO blobTable (blobColumn) VALUES(?)""")
query.bindValue(0,  QtCore.QByteArray(blobField,))
query.exec_()


I hope this can be usefull to someone else!!

Thank to the list anyway!
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to