Re: [sqlite] Blob length in characters vs size in bytes

2009-05-13 Thread John Machin
On 14/05/2009 12:23 AM, Salvatore Di Guida wrote: > 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

Re: [sqlite] Blob length in characters vs size in bytes

2009-05-13 Thread Igor Tandetnik
Salvatore Di Guida wrote: > If so, why do this query return very different answers: > sqlite> select length(X'01'); > 1 > sqlite> select length(X'0'); > SQL error: unrecognized token: "X'0'" ? X'0' is not a valid BLOB literal, so SQLite reports a syntax error. BLOB

Re: [sqlite] Blob length in characters vs size in bytes

2009-05-13 Thread Salvatore Di Guida
Hi! Other questions inline: > To: sqlite-users@sqlite.org > From: itandet...@mvps.org > Date: Wed, 13 May 2009 11:48:11 -0400 > Subject: Re: [sqlite] Blob length in characters vs size in bytes > > Salvatore Di Guida <diguid...@hotmail.com> > wrote: > >

Re: [sqlite] Blob length in characters vs size in bytes

2009-05-13 Thread Igor Tandetnik
Salvatore Di Guida wrote: > 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

[sqlite] Blob length in characters vs size in bytes

2009-05-13 Thread Salvatore Di Guida
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