Hi..

I'm not sure if I've found a bug or not.  I've created a table like so:

CREATE TABLE desc (number primary key, full_line);

Then I've loaded it with taxonomy numbers from NCBI (where "9606" means
"Homo Sapiens", for instance).

sqlite> select * From desc where number="9606";
9606|Homo sapiens
sqlite> select * From desc where number='9606';
9606|Homo sapiens
sqlite> select * From desc where number=9606;
sqlite> select * From desc where number=9606+0;

One workaround is this:

sqlite> select * From desc where number+0=9606;
9606|Homo sapiens

If I change the table definition to this:

CREATE TABLE desc (number integer primary key, full_line);

Then it works as expected:

sqlite> select * From desc where number=9606;
9606|Homo sapiens
sqlite> select * From desc where number='9606';
9606|Homo sapiens

Why is it doing this?  I thought SQLite automatically converted from
numbers to text and vice-versa as needed.  If it converted the 9606 to a
string or the field to a number, then there would be no problem.

Is this a bug?

Thanks!
-- 
PFudd <sql...@ch.pkts.ca>

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

Reply via email to