Quoth Yves Goergen <nospam.l...@unclassified.de>, on 2011-02-06 11:40:17 +0100:
> I'm storing small files in a BLOB field in the database. I'd like to
> determine the size of such a file with an SQL query without fetching the
> data. I tried using the LENGTH() function on that field but it stops
> counting at the first NUL byte. A 3.2 KiB GIF image is reported to be
> only 7 bytes long, that's just the file header length.
> 
> Is this a bug or should I use another function on binary data?

I can't reproduce this with SQLite 3.7.4 from Debian GNU/Linux:

  SQLite version 3.7.4
  Enter ".help" for instructions
  Enter SQL statements terminated with a ";"
  sqlite> create table foo (x);
  sqlite> insert into foo (x) values (x'123412340012341234');
  sqlite> select length(x) from foo;
  length(x)
  9

Silly question: are you sure you're actually _storing_ all the data?
Can you verify that you can get all the bytes out in any way at all?
Information about the schema in use would be helpful, in general.

   ---> Drake Wilson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to