I have a problem with the SQLite CHECk Constraint.
SQLite doesn't check if a inserted value is of a specific type (for example integer).
So i want to check this by the "CHECK" Constraint using the "typeof" function.
But when I execute the following query(s), I get no error and SQLite INSERT the string without a message.
What's wrong?
sqlite> CREATE TABLE test2 (test INTEGER CHECK(TYPEOF(test) == 'INTEGER'));
sqlite> INSERT INTO test2 (test) VALUES (5); //Should work
sqlite> INSERT INTO test2 (test) VALUES ('dd'); //Should not work, but works