Re: [sqlite] Incorrect results set?

2004-11-12 Thread Kurt Welgehausen
CREATE TABLE CRS_2004_001 ( etl_extract_id INTEGER PRIMARY KEY, 
courseid, coursekey char, status, schoolid, lowgrade, highgrade, effectdate, 
  ^^
expdate, description, title, longtitle, etl_error DEFAULT 0 );

SQLite is trying to compare the values as numbers.

You should put types on all your columns.  SQLite doesn't require
explicit typing, but it doesn't ignore explicit types either.  You
can read the details on the documentation page of sqlite.org.

Regards


[sqlite] Incorrect results set?

2004-11-12 Thread Stathy G Touloumis
I am thoroughly confused as to why the following simple query doesn't 
return the proper result set but instead returns the 15 records with a 
coursekey starting with '0E'.  Do I need to escape something?

SQLite version 2.8.15
Enter ".help" for instructions
sqlite> .schema CRS_2004_001
CREATE TABLE CRS_2004_001 ( etl_extract_id INTEGER PRIMARY KEY, 
courseid, coursekey, status, schoolid, lowgrade, highgrade, effectdate, 
expdate, description, title, longtitle, etl_error DEFAULT 0 );

sqlite> select coursekey from CRS_2004_001 where coursekey = '0E120';
0E110
0E120
0E270
0E277
0E288
0E301
0E320
0E410
0E660
0E670
0E681
0E702
0E720
0E732
0E733
Any ideas?