I do not believe NOT NULL is a CHECK constraint, though you could use gender
TEXT CHECK(typeof(gender) <> 'null') is and would work much the same way,
though possibly with less?efficiency.
Peter?
On Thursday, September 10, 2015 4:48 PM, Roman Fleysher <roman.fleysher at
einstein.yu.edu> wrote:
Dear SQLiters,
I am trying to temporarily disable CHECK constraint given in columns of table
definition. As far as I understand,
PRAGMA ignore_check_constraints='yes';
should do it. However this example demonstrates that it is not:
CREATE TABLE subject(
? subjectID? INT,
? gender? ? TEXT NOT NULL
);
CREATE TABLE input(
? subjectID? INT,
? gender? ? TEXT
);
INSERT INTO input(subjectID, gender) VALUES (1, 'female');
INSERT INTO input(subjectID, gender) VALUES (2, 'male');
INSERT INTO input(subjectID) VALUES (3);
PRAGMA ignore_check_constraints='yes';
INSERT INTO subject (rowid) SELECT rowid FROM input;
Error: NOT NULL constraint failed: subject.gender
I am using SQLite 3.8.11.1. Am I misusing the PRAGMA?
Thank you,
Roman
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users