Re: [sqlite] table with check

2013-05-17 Thread Roman Fleysher
, 2013 3:30 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] table with check The "OR NULL" doesn't work the way you think -- it's going to make the whole expression null, which apparently check constraints treat the same as not false. What you want there is "OR ty

Re: [sqlite] table with check

2013-05-17 Thread Peter Aronson
n Fleysher <roman.fleys...@einstein.yu.edu> > To: General Discussion of SQLite Database <sqlite-users@sqlite.org> > Sent: Fri, May 17, 2013 12:19:21 PM > Subject: [sqlite] table with check > > Dear SQLiters, > > I am using sqlite shell, I believe version 3.7.16.2. I crea

Re: [sqlite] table with check

2013-05-17 Thread Richard Hipp
On Fri, May 17, 2013 at 3:16 PM, Roman Fleysher < roman.fleys...@einstein.yu.edu> wrote: > Dear SQLiters, > > I am using sqlite shell, I believe version 3.7.16.2. I created a table > with CHECK condition as: > > CREATE TABLE subject( > subjectID INTEGER PRIMARY KEY, > handedness TEXT CHECK

[sqlite] table with check

2013-05-17 Thread Roman Fleysher
Dear SQLiters, I am using sqlite shell, I believe version 3.7.16.2. I created a table with CHECK condition as: CREATE TABLE subject( subjectID INTEGER PRIMARY KEY, handedness TEXT CHECK (handedness='Left' OR handedness='Right' OR NULL) ); in hopes to be able to insert only "Right",