Re: [sqlite] like, but not equal?

2004-07-26 Thread Dave Hayden
On Jul 24, 2004, at 1:32 AM, [EMAIL PROTECTED] wrote:
  sqlite> select count(*) from newsgroups where name = 
'rec.arts.anime.fandom';
  0
  sqlite> select count(*) from newsgroups where name like 
'rec.arts.anime.fandom';
  1
Figured it out: I was using sqlite3_bind_blob(), but if I change to 
sqlite3_bind_text() it works right.

So I'm guessing that a string on the command line is a text value and 
can never be strictly equal to a blob value (even if they're 
byte-for-byte the same), but LIKE coerces the blob into text?

-D


RE: [sqlite] like, but not equal?

2004-07-24 Thread David Morel
Le sam 24/07/2004 à 21:23, Steve O'Hara a écrit :
> Also, LIKE doesn't use an index so don't expect great performance

Well, although sqlite doesn't use an index, the performance of the like
clause still is truly amazing to me. I'm talking hundreds of thousands
of rows here, filled with paths and filenames...

By the way, I wonder how indexes can be used on like clauses (design
level), as I guess full-featured rdbms make use of them. But how?
Anybody has a clue? 
-- 
***
[EMAIL PROTECTED]
OpenPGP public key: http://www.amakuru.net/dmorel.asc



signature.asc
Description: Ceci est une partie de message	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e=2E?=


Re: [sqlite] like, but not equal?

2004-07-24 Thread dave
On Jul 24, 2004, at 2:45 AM, Paolo Vernazza wrote:
[EMAIL PROTECTED] wrote:
How can a string be like something that has no wildcards, but not 
equal to it? My hunch is it has something to do with character 
encoding, but is that really how it should work?
Like is not case sensitive...
Hey, I never knew that--I always did LOWER(foo) LIKE '%whatever%', 
unnecessarily.

But the string in the database is definitely all lower-case. And, of 
course, when I try it again now it works correctly, the strings are 
equal and not just like.

Ugh.
-D