Igor Tandetnik wrote:
>
> It's possible with an UPDATE statement, but it's expensive. You can't just
> append to an existing blob, you have to provide all of the blob's data,
> old and new.
>
> You might be better off storing the data in separate files, and just using
> SQLite to maintain metadata, like timestamps.
>
Ok, I'll do it that way, it's a smart idea.
The question is, if i use files and not blob data, when i want to update the
data (this time the file, and not the blob field) it can lead to some kind
of fragmentation. Does anyone know, if sqlite know how to deal with it, if i
save it in a blob field? and if i save it in a file, so does ext4 filesystem
for example, deals with it better than sqlite? I guess its a little bit
complicated question, but it's interesting.
>> I have different problem related to this subject:
>> i wrote some code that put blob data (i declared a string and pass it
>> with
>> (char*) to the buffer i send to the blob).
>> The problem is that it takes only 32 bytes of that string.. what with the
>> rest of the string? why does it cut it?
>
> How exactly do you bind that string? Show some code. My guess is, you tell
> SQLite to treat it as NUL-terminated string (rather than specifying its
> length explicitly), and there's a zero byte in your data at offset 32.
> --
> Igor Tandetnik
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
I upload a file which contain the important lines in my code.
The result in the blob data, as i said, is 32 bytes, which means 32 chars:
0123456789:;<=>?@ABCDEFGHIJKLMNO
http://old.nabble.com/file/p31104442/toUpload.c toUpload.c
As you can see i dont have a null at the end but the char 'P' is missing..
--
View this message in context:
http://old.nabble.com/Storing-data-with-SQLite-tp31096174p31104442.html
Sent from the SQLite mailing list archive at Nabble.com.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users