Subject | Re: [firebird-support] Check and null values |
---|---|
Author | Helen Borrie |
Post date | 2005-04-20T08:41:58Z |
At 07:00 AM 20/04/2005 +0000, you wrote:
CHECK (TheValue is null or TheValue in (1,2)). Of course, this check
constraint is not valid if the column TheValue is declared as NOT NULL.
allows null on a non-nullable column. Think about it....
./heLen
>Hi all,No; but you have to specify NULL as an allowed option, viz.
>
>I'm trying to covert an old sqlanywhere database to firebird 1.5. The
>current database schema uses several checks on colums.
>
>I have the following problem, if there is a check on a column to check
>if a value is eg 1 or 2 and the column can have null values,
>sqlanywhere seems to accept null values, while firebird does not.
>Firebird wants to enforce the check, and discards the "can be null" thing?
CHECK (TheValue is null or TheValue in (1,2)). Of course, this check
constraint is not valid if the column TheValue is declared as NOT NULL.
>Is this correct? And is there some property that can disable this?As I mentioned before, it is not valid the have a check constraint that
>
>I could also change my schema to include null in all checks, but what
>happens if I do that, and there is a column that has "not null"?
allows null on a non-nullable column. Think about it....
./heLen