Is it mandatory to use sqlite_encode_binary & sqlite_decode_binary to store data structures/images in blob fields

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it mandatory to use sqlite_encode_binary & sqlite_decode_binary to store data structures/images in blob fields

Tameezuddin
Hello there,

I recently read a code project article wherein he has used above apis from
sqlite to encode and decode blob data. In my project, I have used the same
and exported the data to MS access to be used by a VB application. Guy who
is testing the application were not able to decode the data ( i.e. I mean he
is using vb application to verify the data). I want to know is it necessary
to encode the binary data before we insert into the database and we need to
use decode api to decode the data. Cant, I directly insert whole blob field
directly in the database. The risk I think is the zero terminated strings
that may creep in blob data.

 

Thanks in advance,

Tameez.

 

 

_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Is it mandatory to use sqlite_encode_binary & sqlite_decode_binary to store data structures/images in blob fields

Richard Hipp-3
On Mon, Jul 16, 2012 at 10:46 AM, Tameezuddin <[hidden email]>wrote:

> Hello there,
>
> I recently read a code project article wherein he has used above apis from
> sqlite to encode and decode blob data. In my project, I have used the same
> and exported the data to MS access to be used by a VB application. Guy who
> is testing the application were not able to decode the data ( i.e. I mean
> he
> is using vb application to verify the data). I want to know is it necessary
> to encode the binary data before we insert into the database and we need to
> use decode api to decode the data. Cant, I directly insert whole blob field
> directly in the database. The risk I think is the zero terminated strings
> that may creep in blob data.
>

sqlite_encode_binary() and sqlite_decode_binary() are legacy SQLite Version
2 interfaces which convert binary data to and from zero-terminated strings
so that the binary can be stored in a text-only database.

SQLite3 supports binary data natively and does not require any such
encoding.

SQLite3 has been the preferred version of SQLite for 8 years now.  I wasn't
aware that anybody was still using SQLite version 2.


>
>
>
> Thanks in advance,
>
> Tameez.
>
>
>
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users