Jump to content
Sign in to follow this  
Sfortune

SQL SQLite BLOB

Recommended Posts

I was wondering what file type you store in your data BLOB. Are you storing a specified file type or can you write the data in bytes directly to it? Please advise.

Share this post


Link to post
Share on other sites

A blob is basically anything, and it'll be stored "as-is" in SQLite. Could be a bunch of bytes, could be text or even a full blown file. The database won't know or care what it is, your program will have to deal with that.

Share this post


Link to post
Share on other sites
5 minutes ago, Chronos said:

A blob is basically anything, and it'll be stored "as-is" in SQLite. Could be a bunch of bytes, could be text or even a full blown file. The database won't know or care what it is, your program will have to deal with that.

 

I have seen images, excel files, word documents, etc. Im just wanting to store the data of my class into it and of course read it back as needed in the proper order. I will continue to adjust the code and see the outcome. Thanks Chronos.

Share this post


Link to post
Share on other sites

We are storing byte arrays in Intersect but as Chronos said it could be anything. You might need to store the file type (or name + extension) in another field for reconstruction purposes. BLOBS should do what you need.

Share this post


Link to post
Share on other sites
2 hours ago, jcsnider said:

We are storing byte arrays in Intersect but as Chronos said it could be anything. You might need to store the file type (or name + extension) in another field for reconstruction purposes. BLOBS should do what you need.

 

Awesome just the answer I was looking for. I create my byte array, convert my data to it, then write it. The issue i'm having now is retrieving it. I'm going to try as you said and store it in a field for reconstruction.

 

Figure it out. I was saving an array of classes and its properties too. I serialized it but needed to deserialize it and cast it to and object. After that I can assign it to the array with the correct properties. I think defining the length of the array helped too. But so did you guys! Thanks you can mark this one as answered.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...