How are you inserting the blob? If you are using sqlite3_bind_blob, be sure to give the correct size (maybe you are inadvertently using strlen() or similar to compute a length?). Are you using SQLITE_STATIC, SQLITE_TRANSIENT or passing a destructor function?
When retreiving the value, you should be calling sqlite3_column_blob() first (which makes sure the column is a blob and returns the address), and then sqlite3_column_bytes() to get the size. -----Urspr?ngliche Nachricht----- Von: reddy ykk [mailto:ykk157 at gmail.com] Gesendet: Montag, 09. M?rz 2015 18:32 An: sqlite-users at mailinglists.sqlite.org Betreff: [sqlite] Read Blob Returning bytes till NULL Terminated String Hi Sir, I have a requirement of reading an image data (BLOB) from a database. I could successfully read the length of the blob using sqlite3_column_bytes() but when i try to read the entire blob using sqlite3_column_blob(), i am getting undesired results. I am getting the bytes till NULL terminated string is present. In my case, only 3 bytes of data are being returned by the method. Is there any way that if we specify the length, the whole blob data is retrieved irrespective of the NULL bytes . Thanks and Regards, Kishor Reddy _______________________________________________ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___________________________________________ Gunter Hick Software Engineer Scientific Games International GmbH FN 157284 a, HG Wien Klitschgasse 2-4, A-1130 Vienna, Austria Tel: +43 1 80100 0 E-Mail: hick at scigames.at This communication (including any attachments) is intended for the use of the intended recipient(s) only and may contain information that is confidential, privileged or legally protected. Any unauthorized use or dissemination of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by return e-mail message and delete all copies of the original communication. Thank you for your cooperation.