C++ (Qt)QByteArray b;while (!oFile.atEnd()){ b.append(oFile.readLine());}
C++ (Qt)QFile f("pathToFile");f.open(QIODevice::ReadOnly);QByteArray = f.readAll();f.close();
C++ (Qt)q.exec("CREATE TABLE tbl (TIP INTEGER NOT NULL, Patch TEXT NOT NULL, File BLOB NOT NULL);");
C++ (Qt)QString Tip;QString puts;QByteArray b;q.exec("INSERT INTO tbl (TIP, Patch, File) VALUES ("+Tip+",'"+puts+"','"+b+"');");
C++ (Qt)q.exec("SELECT * FROM tbl WHERE Patch='"+puts+"' ;");QByteArray z=q.value(2).toByteArray(); // возвращает пустую строчку;QString z=q.value(2).toString(); // возвращает то что написано в ячейке
C++ (Qt)query.prepare ("INSERT INTO tbl (TIP, Patch, File) VALUES (:TIP, :Patch, :File);");query.bindValue (":TIP", Tip);query.bindValue (":Patch", puts);query.bindValue (":File", b);query.exec ();
C++ (Qt)qint64 bb=b.toBase64();
C++ (Qt)QByteArray z=q.value(2).toByteArray();
C++ (Qt)QByteArray b = oFile.readAll();QByteArray bb=b.toBase64();q.prepare ("INSERT INTO tbl (TIP, Patch, File) VALUES (:TIP, :Patch, :File);");q.bindValue (":TIP", Tip);q.bindValue (":Patch", puts);q.bindValue (":File", bb);
C++ (Qt)q.exec("SELECT * FROM tbl WHERE Patch='"+puts+"' ;");while(q.next()){ QByteArray z=QByteArray::fromBase64 (q.value(2).toByteArray()); destFile2.write(z);}
C++ (Qt) query.prepare("SELECT File FROM tbl WHERE Patch=:Patch;"); query.bindValue (":Patch", puts);