On 19 May 2015, at 4:07pm, Roman Fleysher <roman.fleysher at einstein.yu.edu>
wrote:
> CREATE TABLE Exam(
> examID TEXT PRIMARY KEY NOT NULL
Works fine for me. I tested inserting as text, integer and real in case they
did something weird to LIKE.
SQLite version 3.8.5 2014-08-15 22:37:57
Enter ".help" for usage hints.
sqlite> CREATE TABLE Exam(
...> examID TEXT PRIMARY KEY NOT NULL);
sqlite> INSERT INTO Exam VALUES ('30');
sqlite> SELECT * FROM Exam;
30
sqlite> select 'a'||examID||'a', typeof(examID) from Exam where Exam.examID
like 30;
a30a|text
sqlite> select 'a'||examID||'a', typeof(examID) from Exam where Exam.examID=30;
a30a|text
sqlite> DELETE FROM Exam;
sqlite> INSERT INTO Exam VALUES (30);
sqlite> select 'a'||examID||'a', typeof(examID) from Exam where Exam.examID
like 30;
a30a|text
sqlite> select 'a'||examID||'a', typeof(examID) from Exam where Exam.examID=30;
a30a|text
sqlite>
sqlite> DELETE FROM Exam;
sqlite> INSERT INTO Exam VALUES (30.0);
sqlite> select 'a'||examID||'a', typeof(examID) from Exam where Exam.examID
like 30;
sqlite> select 'a'||examID||'a', typeof(examID) from Exam where Exam.examID=30;
sqlite> select 'a'||examID||'a', typeof(examID) from Exam;
a30.0a|text
Is your database corrupt ? Can you run the PRAGMA on it ?
Simon.