[Interest] Qt Sql BLOB data converting

Yauheni Pervenenka yauheni.pervenenka at viber.com
Mon Nov 28 19:16:02 CET 2022


Thiago, hello, thanks for your reply, sorry have no instructions for create
and insert, but have data base with one value which can't be parsed
correct(db is cut to one value for provide example)

https://bugreports.qt.io/browse/QTBUG-108992

On Mon, Nov 28, 2022 at 9:07 PM Thiago Macieira <thiago.macieira at intel.com>
wrote:

> On Monday, 28 November 2022 01:00:01 PST Yauheni Pervenenka via Interest
> wrote:
> > QSqlQuery query("SELECT value from table");
> > while (query.next()) {
> > const auto value = query.value(0);
> > qDebug() << value.toByteArray().size(); // size 52
> > qDebug() << value.toString().size(); // size 30
> > qDebug() << value.toByteArray().toHex(); // size 104
> > }
>
> If your data is binary, don't use toString(). That's definitely wrong.
>
> Can you show the example from the CREATE TABLE command, including the
> INSERT
> one?
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Cloud Software Architect - Intel DCAI Cloud Engineering
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20221128/1d2a3f2c/attachment.htm>


More information about the Interest mailing list