SQLiters,

First of all: Rocking great RDBMS. I love it!

Now, to my question. I'm confused about the typelessness of SQLite, because I've found a place where the type *does* seem to matter. This example demonstrates the issue:

sqlite> create table foo (age int);
sqlite> insert into foo values (7);
sqlite> select lower(age) from foo;
lower(age)
----------
7
sqlite> select * from foo where lower(age) = 7;
sqlite> select * from foo where lower(age) = '7';
age
----------
7

If I use LOWER() on an int field and then specify an unquoted value (7), I don't get a result. I have to cast my parameter to a string by adding single quotes ('7') in order to get my result. But if SQLite is typeless, why does this make a difference? Am I missing something?

Many TIA,

David



Reply via email to