Hi all!
Since I am a newcomer in SQLite, as a preliminary question, what is the 
difference between 
sqlite> select length(X'01');
and
sqlite> select length('01');
It seems that the former gives the size in bytes, the latter the length of the 
string.

The SQLite documentation says that the length function returns the 
string length of /X/ in characters if /X/ is a string, or in bytes if 
/X/ is a blob.

However, I tried this example:

sqlite3 test.db

SQLite version 3.6.10

Enter ".help" for instructions

Enter SQL statements terminated with a ";"

sqlite> create table x ( a TEXT, b BLOB );

sqlite> insert into x values ( 'a', 'a' );

sqlite> insert into x values ( 'abcd', 'abcd' );

sqlite> select length(a), length(b) from x;

1|1

4|4



The length function, then, measures the length in characters of the 
blob. What can I do in order to obtain the size in bytes of the blob?
Thanks in advance!

Salvatore

_________________________________________________________________
PiĆ¹ di 100 Emoticon gratis per il tuo Messenger!
http://intrattenimento.it.msn.com/emoticon
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to