Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with Check Constraint using NVL
dany.morin_at_mobilair.qc.ca (Dany morin) wrote in message news:<fe2795e4.0402051200.65be11d6_at_posting.google.com>...
> I know that the second declaration of this constraint works well.
> However, I want to understant why the first one doesn't work.
>
> ALTER TABLE x ADD CONSTRAINT ck_x_c3 CHECK ((code1 IS NULL AND type1
> IS NULL) OR (code1 IS NOT NULL AND NVL(type1 ,'-1') IN
> ('1','2','3','4','N','U')));
Well it works for me. Please post an example of an insert or update that does not work. Received on Fri Feb 06 2004 - 04:20:16 CST